Commit 32cc4011 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 8b195913
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment