kernel32: Make GetOverlappedResult crash on NULL args as native does.

This commit is contained in:
Nikolay Sivov 2009-01-22 15:00:33 +03:00 committed by Alexandre Julliard
parent 8b1959134e
commit 32cc4011ee
3 changed files with 9 additions and 8 deletions

View File

@ -603,12 +603,6 @@ BOOL WINAPI GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped,
TRACE( "(%p %p %p %x)\n", hFile, lpOverlapped, lpTransferred, bWait );
if ( lpOverlapped == NULL )
{
ERR("lpOverlapped was null\n");
return FALSE;
}
status = lpOverlapped->Internal;
if (status == STATUS_PENDING)
{
@ -624,7 +618,7 @@ BOOL WINAPI GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped,
status = lpOverlapped->Internal;
}
if (lpTransferred) *lpTransferred = lpOverlapped->InternalHigh;
*lpTransferred = lpOverlapped->InternalHigh;
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;

View File

@ -2022,6 +2022,12 @@ static void test_overlapped(void)
DWORD r, result;
/* GetOverlappedResult crashes if the 2nd or 3rd param are NULL */
if (0) /* tested: WinXP */
{
GetOverlappedResult(0, NULL, &result, FALSE);
GetOverlappedResult(0, &ov, NULL, FALSE);
GetOverlappedResult(0, NULL, NULL, FALSE);
}
memset( &ov, 0, sizeof ov );
result = 1;

View File

@ -1861,6 +1861,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
BOOL multi_use = lsp->multi_use;
OVERLAPPED ovl;
HANDLE pipe_event;
DWORD bytes;
TRACE("Starting threader for %s.\n",debugstr_guid(&lsp->clsid));
@ -1929,7 +1930,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
}
WriteFile(hPipe,buffer,buflen,&res,&ovl);
GetOverlappedResult(hPipe, &ovl, NULL, TRUE);
GetOverlappedResult(hPipe, &ovl, &bytes, TRUE);
HeapFree(GetProcessHeap(),0,buffer);
FlushFileBuffers(hPipe);