Use the correct structure for passing 64-bit offset: LARGE_INTEGER.
---
 mingw-w64-crt/testcases/t_fseeko64.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mingw-w64-crt/testcases/t_fseeko64.c 
b/mingw-w64-crt/testcases/t_fseeko64.c
index f04f74b75ec6..aad3ebc5920f 100644
--- a/mingw-w64-crt/testcases/t_fseeko64.c
+++ b/mingw-w64-crt/testcases/t_fseeko64.c
@@ -8,14 +8,11 @@ static const char *writebuf = "TESTVECTORSTRING";
 static char szPath[MAX_PATH];
 
 static int writefile(const char *path){
-  OVERLAPPED ov;
+  LARGE_INTEGER li = { .QuadPart = 0x100000000ull };
   DWORD dwResult;
-  memset(&ov,0,sizeof(OVERLAPPED));
-  ov.Offset = 0x0;
-  ov.OffsetHigh = 0x1;
   HANDLE fd = CreateFileA(path,GENERIC_READ | GENERIC_WRITE, 0, NULL, 
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
   if (fd == INVALID_HANDLE_VALUE) return 1;
-  if (SetFilePointer(fd, ov.Offset, (PLONG) &ov.OffsetHigh, FILE_BEGIN) == 
INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) {
+  if (SetFilePointer(fd, li.LowPart, &li.HighPart, FILE_BEGIN) == 
INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) {
     printf("writefile: seek failed: winerror=%lu\n", GetLastError());
     CloseHandle(fd);
     return 1;
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to