[PATCH v4 1/3] storage.dll16: Fix negation in IStream::Seek.

Zebediah Figura z.figura12 at gmail.com
Sun Feb 12 12:03:20 CST 2017


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/storage.dll16/storage.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/storage.dll16/storage.c b/dlls/storage.dll16/storage.c
index 74aa7f9..7a5b367 100644
--- a/dlls/storage.dll16/storage.c
+++ b/dlls/storage.dll16/storage.c
@@ -1196,9 +1196,8 @@ HRESULT CDECL IStream16_fnSeek(IStream16 *iface, LARGE_INTEGER offset, DWORD whe
 		break;
 	case SEEK_CUR:
 		if (offset.u.HighPart < 0) {
-			/* FIXME: is this negation correct ? */
-			offset.u.HighPart = -offset.u.HighPart;
-			offset.u.LowPart = (0xffffffff ^ offset.u.LowPart)+1;
+			offset.u.HighPart = ~offset.u.HighPart + (offset.u.LowPart ? 0 : 1);
+			offset.u.LowPart = -offset.u.LowPart;
 
 			assert(offset.u.HighPart==0);
 			assert(This->offset.u.LowPart >= offset.u.LowPart);
-- 
2.7.4




More information about the wine-patches mailing list