Fixed dealing with errors getting the file size from Windows
Using SetFilePointer() for compatibility with old Windows implies a specific management of errors....edge.strict_endians
parent
ebf35000c9
commit
a28e2a8606
|
@ -592,9 +592,11 @@ static s64 ntfs_device_win32_getsize(HANDLE handle)
|
|||
{
|
||||
LONG loword, hiword;
|
||||
|
||||
SetLastError(NO_ERROR);
|
||||
hiword = 0;
|
||||
loword = SetFilePointer(handle, 0, &hiword, 2);
|
||||
if (loword == INVALID_FILE_SIZE) {
|
||||
if ((loword == INVALID_SET_FILE_POINTER)
|
||||
&& (GetLastError() != NO_ERROR)) {
|
||||
errno = ntfs_w32error_to_errno(GetLastError());
|
||||
ntfs_log_trace("Couldn't get file size.\n");
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue