Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d32abd77
Commit
d32abd77
authored
May 27, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Don't store file size in FileLockBytesImpl.
parent
5a8d7328
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
20 deletions
+3
-20
filelockbytes.c
dlls/ole32/filelockbytes.c
+3
-20
No files found.
dlls/ole32/filelockbytes.c
View file @
d32abd77
...
@@ -49,7 +49,6 @@ typedef struct FileLockBytesImpl
...
@@ -49,7 +49,6 @@ typedef struct FileLockBytesImpl
{
{
ILockBytes
ILockBytes_iface
;
ILockBytes
ILockBytes_iface
;
LONG
ref
;
LONG
ref
;
ULARGE_INTEGER
filesize
;
HANDLE
hfile
;
HANDLE
hfile
;
DWORD
flProtect
;
DWORD
flProtect
;
LPWSTR
pwcsName
;
LPWSTR
pwcsName
;
...
@@ -108,8 +107,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
...
@@ -108,8 +107,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
This
->
ILockBytes_iface
.
lpVtbl
=
&
FileLockBytesImpl_Vtbl
;
This
->
ILockBytes_iface
.
lpVtbl
=
&
FileLockBytesImpl_Vtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
hfile
=
hFile
;
This
->
hfile
=
hFile
;
This
->
filesize
.
u
.
LowPart
=
GetFileSize
(
This
->
hfile
,
&
This
->
filesize
.
u
.
HighPart
);
This
->
flProtect
=
GetProtectMode
(
openFlags
);
This
->
flProtect
=
GetProtectMode
(
openFlags
);
if
(
pwcsName
)
{
if
(
pwcsName
)
{
...
@@ -129,8 +126,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
...
@@ -129,8 +126,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
else
else
This
->
pwcsName
=
NULL
;
This
->
pwcsName
=
NULL
;
TRACE
(
"file len %u
\n
"
,
This
->
filesize
.
u
.
LowPart
);
*
pLockBytes
=
&
This
->
ILockBytes_iface
;
*
pLockBytes
=
&
This
->
ILockBytes_iface
;
return
S_OK
;
return
S_OK
;
...
@@ -248,7 +243,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
...
@@ -248,7 +243,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
ULONG
*
pcbWritten
)
/* [out] */
ULONG
*
pcbWritten
)
/* [out] */
{
{
FileLockBytesImpl
*
This
=
impl_from_ILockBytes
(
iface
);
FileLockBytesImpl
*
This
=
impl_from_ILockBytes
(
iface
);
ULONG
size_needed
=
ulOffset
.
u
.
LowPart
+
cb
;
ULONG
bytes_left
=
cb
;
ULONG
bytes_left
=
cb
;
const
BYTE
*
writePtr
=
pv
;
const
BYTE
*
writePtr
=
pv
;
BOOL
ret
;
BOOL
ret
;
...
@@ -266,14 +260,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
...
@@ -266,14 +260,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
if
(
pcbWritten
)
if
(
pcbWritten
)
*
pcbWritten
=
0
;
*
pcbWritten
=
0
;
if
(
size_needed
>
This
->
filesize
.
u
.
LowPart
)
{
ULARGE_INTEGER
newSize
;
newSize
.
u
.
HighPart
=
0
;
newSize
.
u
.
LowPart
=
size_needed
;
ILockBytes_SetSize
(
iface
,
newSize
);
}
offset
.
QuadPart
=
ulOffset
.
QuadPart
;
offset
.
QuadPart
=
ulOffset
.
QuadPart
;
ret
=
SetFilePointerEx
(
This
->
hfile
,
offset
,
NULL
,
FILE_BEGIN
);
ret
=
SetFilePointerEx
(
This
->
hfile
,
offset
,
NULL
,
FILE_BEGIN
);
...
@@ -316,10 +302,7 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
...
@@ -316,10 +302,7 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
LARGE_INTEGER
newpos
;
LARGE_INTEGER
newpos
;
if
(
This
->
filesize
.
u
.
LowPart
==
newSize
.
u
.
LowPart
)
TRACE
(
"new size %u
\n
"
,
newSize
.
u
.
LowPart
);
return
hr
;
TRACE
(
"from %u to %u
\n
"
,
This
->
filesize
.
u
.
LowPart
,
newSize
.
u
.
LowPart
);
newpos
.
QuadPart
=
newSize
.
QuadPart
;
newpos
.
QuadPart
=
newSize
.
QuadPart
;
if
(
SetFilePointerEx
(
This
->
hfile
,
newpos
,
NULL
,
FILE_BEGIN
))
if
(
SetFilePointerEx
(
This
->
hfile
,
newpos
,
NULL
,
FILE_BEGIN
))
...
@@ -327,7 +310,6 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
...
@@ -327,7 +310,6 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
SetEndOfFile
(
This
->
hfile
);
SetEndOfFile
(
This
->
hfile
);
}
}
This
->
filesize
=
newSize
;
return
hr
;
return
hr
;
}
}
...
@@ -412,7 +394,8 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface,
...
@@ -412,7 +394,8 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface,
pstatstg
->
pwcsName
=
NULL
;
pstatstg
->
pwcsName
=
NULL
;
pstatstg
->
type
=
STGTY_LOCKBYTES
;
pstatstg
->
type
=
STGTY_LOCKBYTES
;
pstatstg
->
cbSize
=
This
->
filesize
;
pstatstg
->
cbSize
.
u
.
LowPart
=
GetFileSize
(
This
->
hfile
,
&
pstatstg
->
cbSize
.
u
.
HighPart
);
/* FIXME: If the implementation is exported, we'll need to set other fields. */
/* FIXME: If the implementation is exported, we'll need to set other fields. */
return
S_OK
;
return
S_OK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment