[PATCH] ole32: ignore HighPart in the Seek method HGLOBAL streams.
Reece Dunn
msclrhd at googlemail.com
Tue Feb 23 02:24:16 CST 2010
Hi,
This fixes the todo_wines in ole32:hglobalstream.
- Reece
-------------- next part --------------
From 3764cec38903d95052bc7d85c9c69ecdb70e9548 Mon Sep 17 00:00:00 2001
From: Reece Dunn <msclrhd at gmail.com>
Date: Tue, 23 Feb 2010 08:20:37 +0000
Subject: [PATCH] ole32: ignore HighPart in the Seek method HGLOBAL streams.
---
dlls/ole32/hglobalstream.c | 6 ++++--
dlls/ole32/tests/hglobalstream.c | 3 ---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c
index c43d499..9246126 100644
--- a/dlls/ole32/hglobalstream.c
+++ b/dlls/ole32/hglobalstream.c
@@ -395,9 +395,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_Seek(
* If the file pointer ends-up after the end of the stream, the next Write operation will
* make the file larger. This is how it is documented.
*/
- if (dlibMove.QuadPart < 0 && newPosition.QuadPart < -dlibMove.QuadPart) return STG_E_INVALIDFUNCTION;
+ if (dlibMove.u.LowPart < 0 && newPosition.u.LowPart < -dlibMove.u.LowPart)
+ return STG_E_INVALIDFUNCTION;
- newPosition.QuadPart += dlibMove.QuadPart;
+ newPosition.u.HighPart = 0;
+ newPosition.u.LowPart += dlibMove.u.LowPart;
if (plibNewPosition) *plibNewPosition = newPosition;
This->currentPosition = newPosition;
diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c
index 4fee612..ea7a646 100644
--- a/dlls/ole32/tests/hglobalstream.c
+++ b/dlls/ole32/tests/hglobalstream.c
@@ -79,17 +79,14 @@ static void test_streamonhglobal(IStream *pStream)
ll.u.HighPart = -1;
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
- todo_wine
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
- todo_wine
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
/* ignores HighPart */
ll.u.HighPart = -1;
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, NULL);
- todo_wine
ok_ole_success(hr, "IStream_Seek");
hr = IStream_Commit(pStream, STGC_DEFAULT);
--
1.6.3.3
More information about the wine-patches
mailing list