kernel32: Make GetOverlappedResult crash on NULL args as native does.
This commit is contained in:
parent
8b1959134e
commit
32cc4011ee
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue