rwops: Use SetFilePointerEx on Windows for appending writes.
Fixes #7900. (cherry picked from commit 769bf2ebcca8f0cbcde4ec50008942f4eda57f4a)
This commit is contained in:
@@ -254,8 +254,9 @@ windows_file_write(SDL_RWops *context, const void *ptr, Sint64 size)
|
|||||||
|
|
||||||
/* if in append mode, we must go to the EOF before write */
|
/* if in append mode, we must go to the EOF before write */
|
||||||
if (context->hidden.windowsio.append) {
|
if (context->hidden.windowsio.append) {
|
||||||
if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) ==
|
LARGE_INTEGER windowsoffset;
|
||||||
INVALID_SET_FILE_POINTER) {
|
windowsoffset.QuadPart = 0;
|
||||||
|
if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, FILE_END)) {
|
||||||
return SDL_Error(SDL_EFWRITE);
|
return SDL_Error(SDL_EFWRITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user