Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0aedac34
Commit
0aedac34
authored
Mar 06, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Mar 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix CopyTo to work correctly with LARGE_INTEGERs.
parent
a555658b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
30 deletions
+11
-30
hglobalstream.c
dlls/ole32/hglobalstream.c
+11
-30
No files found.
dlls/ole32/hglobalstream.c
View file @
0aedac34
...
...
@@ -467,24 +467,16 @@ static HRESULT WINAPI HGLOBALStreamImpl_CopyTo(
TRACE
(
"(%p, %p, %d, %p, %p)
\n
"
,
iface
,
pstm
,
cb
.
u
.
LowPart
,
pcbRead
,
pcbWritten
);
/*
* Sanity check
*/
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 temporarly
* there is surely 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
;
...
...
@@ -492,7 +484,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_CopyTo(
if
(
FAILED
(
hr
))
break
;
totalBytesRead
.
u
.
Low
Part
+=
bytesRead
;
totalBytesRead
.
Quad
Part
+=
bytesRead
;
if
(
bytesRead
)
{
...
...
@@ -500,29 +492,18 @@ static HRESULT WINAPI HGLOBALStreamImpl_CopyTo(
if
(
FAILED
(
hr
))
break
;
totalBytesWritten
.
u
.
Low
Part
+=
bytesWritten
;
totalBytesWritten
.
Quad
Part
+=
bytesWritten
;
}
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