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
60ee0c3e
Commit
60ee0c3e
authored
Mar 06, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Mar 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix CopyTo to work correctly with LARGE_INTEGERs.
parent
be874f1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
27 deletions
+11
-27
stg_stream.c
dlls/ole32/stg_stream.c
+11
-27
No files found.
dlls/ole32/stg_stream.c
View file @
60ee0c3e
...
...
@@ -689,28 +689,23 @@ static HRESULT WINAPI StgStreamImpl_CopyTo(
if
(
pstm
==
0
)
return
STG_E_INVALIDPOINTER
;
totalBytesRead
.
u
.
LowPart
=
totalBytesRead
.
u
.
High
Part
=
0
;
totalBytesWritten
.
u
.
LowPart
=
totalBytesWritten
.
u
.
High
Part
=
0
;
totalBytesRead
.
Quad
Part
=
0
;
totalBytesWritten
.
Quad
Part
=
0
;
/*
* use stack to store data temporarily
* there is surely a more performant way of doing it, for now this basic
* implementation will do the job
*/
while
(
cb
.
u
.
LowPart
>
0
)
while
(
cb
.
QuadPart
>
0
)
{
if
(
cb
.
u
.
LowPart
>=
128
)
copySize
=
128
;
if
(
cb
.
QuadPart
>=
sizeof
(
tmpBuffer
)
)
copySize
=
sizeof
(
tmpBuffer
)
;
else
copySize
=
cb
.
u
.
LowPart
;
IStream_Read
(
iface
,
tmpBuffer
,
copySize
,
&
bytesRead
);
totalBytesRead
.
u
.
Low
Part
+=
bytesRead
;
totalBytesRead
.
Quad
Part
+=
bytesRead
;
IStream_Write
(
pstm
,
tmpBuffer
,
bytesRead
,
&
bytesWritten
);
totalBytesWritten
.
u
.
Low
Part
+=
bytesWritten
;
totalBytesWritten
.
Quad
Part
+=
bytesWritten
;
/*
* Check that read & write operations were successful
...
...
@@ -723,25 +718,14 @@ static HRESULT WINAPI StgStreamImpl_CopyTo(
}
if
(
bytesRead
!=
copySize
)
cb
.
u
.
Low
Part
=
0
;
cb
.
Quad
Part
=
0
;
else
cb
.
u
.
Low
Part
-=
bytesRead
;
cb
.
Quad
Part
-=
bytesRead
;
}
/*
* Update number of bytes read and written
*/
if
(
pcbRead
)
{
pcbRead
->
u
.
LowPart
=
totalBytesRead
.
u
.
LowPart
;
pcbRead
->
u
.
HighPart
=
totalBytesRead
.
u
.
HighPart
;
}
if
(
pcbRead
)
pcbRead
->
QuadPart
=
totalBytesRead
.
QuadPart
;
if
(
pcbWritten
)
pcbWritten
->
QuadPart
=
totalBytesWritten
.
QuadPart
;
if
(
pcbWritten
)
{
pcbWritten
->
u
.
LowPart
=
totalBytesWritten
.
u
.
LowPart
;
pcbWritten
->
u
.
HighPart
=
totalBytesWritten
.
u
.
HighPart
;
}
return
hr
;
}
...
...
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