Fix blatantly wrong SetFilePointer() calls.

This commit is contained in:
Andreas Mohr 2003-04-14 21:33:49 +00:00 committed by Alexandre Julliard
parent 94c02fef1a
commit 51c38cc729
2 changed files with 6 additions and 4 deletions

View File

@ -605,7 +605,7 @@ int _locking(int fd, int mode, LONG nbytes)
(mode==_LK_NBRLCK)?"_LK_NBRLCK":
"UNKNOWN");
if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == 0xffffffff)
if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == INVALID_SET_FILE_POINTER)
{
FIXME ("Seek failed\n");
*MSVCRT__errno() = MSVCRT_EINVAL; /* FIXME */

View File

@ -110,7 +110,8 @@ STORAGE_get_big_block(HANDLE hf,int n,BYTE *block)
DWORD result;
assert(n>=-1);
if (!SetFilePointer( hf, (n+1)*BIGSIZE, NULL, SEEK_SET ))
if ((SetFilePointer( hf, (n+1)*BIGSIZE, NULL,
SEEK_SET ) == INVALID_SET_FILE_POINTER) && GetLastError())
{
WARN(" seek failed (%ld)\n",GetLastError());
return FALSE;
@ -132,9 +133,10 @@ STORAGE_put_big_block(HANDLE hf,int n,BYTE *block)
DWORD result;
assert(n>=-1);
if (!SetFilePointer( hf, (n+1)*BIGSIZE, NULL, SEEK_SET ))
if ((SetFilePointer( hf, (n+1)*BIGSIZE, NULL,
SEEK_SET ) == INVALID_SET_FILE_POINTER) && GetLastError())
{
WARN(" seek failed (%ld)\n",GetLastError());
WARN("seek failed (%ld)\n",GetLastError());
return FALSE;
}
if (!WriteFile( hf, block, BIGSIZE, &result, NULL ) || result != BIGSIZE)