mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
fix all cabinet fdi winetests (except the ones marked as (todo_wine)
svn path=/trunk/; revision=35973
This commit is contained in:
parent
9e8367f15e
commit
b0a663b4a6
|
@ -392,7 +392,7 @@ SetFilePointer(HANDLE hFile,
|
||||||
if(IsConsoleHandle(hFile))
|
if(IsConsoleHandle(hFile))
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
return -1;
|
return INVALID_SET_FILE_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpDistanceToMoveHigh)
|
if (lpDistanceToMoveHigh)
|
||||||
|
@ -408,34 +408,48 @@ SetFilePointer(HANDLE hFile,
|
||||||
switch(dwMoveMethod)
|
switch(dwMoveMethod)
|
||||||
{
|
{
|
||||||
case FILE_CURRENT:
|
case FILE_CURRENT:
|
||||||
NtQueryInformationFile(hFile,
|
errCode = NtQueryInformationFile(hFile,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
&FilePosition,
|
&FilePosition,
|
||||||
sizeof(FILE_POSITION_INFORMATION),
|
sizeof(FILE_POSITION_INFORMATION),
|
||||||
FilePositionInformation);
|
FilePositionInformation);
|
||||||
FilePosition.CurrentByteOffset.QuadPart += Distance.QuadPart;
|
FilePosition.CurrentByteOffset.QuadPart += Distance.QuadPart;
|
||||||
|
if (!NT_SUCCESS(errCode))
|
||||||
|
{
|
||||||
|
if (lpDistanceToMoveHigh != NULL)
|
||||||
|
*lpDistanceToMoveHigh = -1;
|
||||||
|
SetLastErrorByStatus(errCode);
|
||||||
|
return INVALID_SET_FILE_POINTER;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case FILE_END:
|
case FILE_END:
|
||||||
NtQueryInformationFile(hFile,
|
errCode = NtQueryInformationFile(hFile,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
&FileStandard,
|
&FileStandard,
|
||||||
sizeof(FILE_STANDARD_INFORMATION),
|
sizeof(FILE_STANDARD_INFORMATION),
|
||||||
FileStandardInformation);
|
FileStandardInformation);
|
||||||
FilePosition.CurrentByteOffset.QuadPart =
|
FilePosition.CurrentByteOffset.QuadPart =
|
||||||
FileStandard.EndOfFile.QuadPart + Distance.QuadPart;
|
FileStandard.EndOfFile.QuadPart + Distance.QuadPart;
|
||||||
|
if (!NT_SUCCESS(errCode))
|
||||||
|
{
|
||||||
|
if (lpDistanceToMoveHigh != NULL)
|
||||||
|
*lpDistanceToMoveHigh = -1;
|
||||||
|
SetLastErrorByStatus(errCode);
|
||||||
|
return INVALID_SET_FILE_POINTER;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case FILE_BEGIN:
|
case FILE_BEGIN:
|
||||||
FilePosition.CurrentByteOffset.QuadPart = Distance.QuadPart;
|
FilePosition.CurrentByteOffset.QuadPart = Distance.QuadPart;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return -1;
|
return INVALID_SET_FILE_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FilePosition.CurrentByteOffset.QuadPart < 0)
|
if(FilePosition.CurrentByteOffset.QuadPart < 0)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NEGATIVE_SEEK);
|
SetLastError(ERROR_NEGATIVE_SEEK);
|
||||||
return -1;
|
return INVALID_SET_FILE_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpDistanceToMoveHigh == NULL && FilePosition.CurrentByteOffset.HighPart != 0)
|
if (lpDistanceToMoveHigh == NULL && FilePosition.CurrentByteOffset.HighPart != 0)
|
||||||
|
@ -443,7 +457,7 @@ SetFilePointer(HANDLE hFile,
|
||||||
/* If we're moving the pointer outside of the 32 bit boundaries but
|
/* If we're moving the pointer outside of the 32 bit boundaries but
|
||||||
the application only passed a 32 bit value we need to bail out! */
|
the application only passed a 32 bit value we need to bail out! */
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return -1;
|
return INVALID_SET_FILE_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
errCode = NtSetInformationFile(hFile,
|
errCode = NtSetInformationFile(hFile,
|
||||||
|
@ -457,7 +471,7 @@ SetFilePointer(HANDLE hFile,
|
||||||
*lpDistanceToMoveHigh = -1;
|
*lpDistanceToMoveHigh = -1;
|
||||||
|
|
||||||
SetLastErrorByStatus(errCode);
|
SetLastErrorByStatus(errCode);
|
||||||
return -1;
|
return INVALID_SET_FILE_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpDistanceToMoveHigh != NULL)
|
if (lpDistanceToMoveHigh != NULL)
|
||||||
|
|
Loading…
Reference in a new issue