From 1e31f76d3e4c93f6504efaaf2e299f6f0b3313e9 Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Sun, 21 Dec 2025 18:31:02 +0100 Subject: [PATCH] Fix 32bit SetFilePointer --- hook/iohook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hook/iohook.c b/hook/iohook.c index 3284173..04bf340 100644 --- a/hook/iohook.c +++ b/hook/iohook.c @@ -825,12 +825,12 @@ static DWORD WINAPI iohook_SetFilePointer( irp.seek_origin = dwMoveMethod; /* This is a clumsy API. In 32-bit mode lDistanceToMove is a signed 32-bit - int, but in 64-bit mode it is a 32-bit UNsigned int. Care must be taken + int, but in 64-bit mode it is a 32-bit unsigned int. Care must be taken with sign-extension vs zero-extension here. */ if (lpDistanceToMoveHigh != NULL) { irp.seek_offset = ((( int64_t) *lpDistanceToMoveHigh) << 32) | - ((uint64_t) lDistanceToMove ) ; + ((uint32_t) lDistanceToMove ) ; } else { irp.seek_offset = ( int64_t) lDistanceToMove; }