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
{
ILockBytes
ILockBytes_iface
;
LONG
ref
;
ULARGE_INTEGER
filesize
;
HANDLE
hfile
;
DWORD
flProtect
;
LPWSTR
pwcsName
;
...
...
@@ -108,8 +107,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
This
->
ILockBytes_iface
.
lpVtbl
=
&
FileLockBytesImpl_Vtbl
;
This
->
ref
=
1
;
This
->
hfile
=
hFile
;
This
->
filesize
.
u
.
LowPart
=
GetFileSize
(
This
->
hfile
,
&
This
->
filesize
.
u
.
HighPart
);
This
->
flProtect
=
GetProtectMode
(
openFlags
);
if
(
pwcsName
)
{
...
...
@@ -129,8 +126,6 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
else
This
->
pwcsName
=
NULL
;
TRACE
(
"file len %u
\n
"
,
This
->
filesize
.
u
.
LowPart
);
*
pLockBytes
=
&
This
->
ILockBytes_iface
;
return
S_OK
;
...
...
@@ -248,7 +243,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
ULONG
*
pcbWritten
)
/* [out] */
{
FileLockBytesImpl
*
This
=
impl_from_ILockBytes
(
iface
);
ULONG
size_needed
=
ulOffset
.
u
.
LowPart
+
cb
;
ULONG
bytes_left
=
cb
;
const
BYTE
*
writePtr
=
pv
;
BOOL
ret
;
...
...
@@ -266,14 +260,6 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
if
(
pcbWritten
)
*
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
;
ret
=
SetFilePointerEx
(
This
->
hfile
,
offset
,
NULL
,
FILE_BEGIN
);
...
...
@@ -316,10 +302,7 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
HRESULT
hr
=
S_OK
;
LARGE_INTEGER
newpos
;
if
(
This
->
filesize
.
u
.
LowPart
==
newSize
.
u
.
LowPart
)
return
hr
;
TRACE
(
"from %u to %u
\n
"
,
This
->
filesize
.
u
.
LowPart
,
newSize
.
u
.
LowPart
);
TRACE
(
"new size %u
\n
"
,
newSize
.
u
.
LowPart
);
newpos
.
QuadPart
=
newSize
.
QuadPart
;
if
(
SetFilePointerEx
(
This
->
hfile
,
newpos
,
NULL
,
FILE_BEGIN
))
...
...
@@ -327,7 +310,6 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
SetEndOfFile
(
This
->
hfile
);
}
This
->
filesize
=
newSize
;
return
hr
;
}
...
...
@@ -412,7 +394,8 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface,
pstatstg
->
pwcsName
=
NULL
;
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. */
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