rwops: Use SetFilePointerEx on Windows for appending writes.

Fixes #7900.
This commit is contained in:
Ryan C. Gordon 2023-07-01 00:30:23 -04:00
parent fc0854651b
commit 769bf2ebcc
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 3 additions and 2 deletions

View File

@ -277,8 +277,9 @@ windows_file_write(SDL_RWops *context, const void *ptr, size_t size,
/* if in append mode, we must go to the EOF before write */
if (context->hidden.windowsio.append) {
if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) ==
INVALID_SET_FILE_POINTER) {
LARGE_INTEGER windowsoffset;
windowsoffset.QuadPart = 0;
if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, FILE_END)) {
SDL_Error(SDL_EFWRITE);
return 0;
}