kernel32/tests: Don't test function directly when reporting GetLastError().

This commit is contained in:
André Hentschel 2015-01-20 23:56:41 +01:00 committed by Alexandre Julliard
parent ba0d1586ff
commit ae1251596e
1 changed files with 3 additions and 2 deletions

View File

@ -89,7 +89,7 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD
{
struct rpcThreadArgs rpcargs;
HANDLE thread;
DWORD threadId;
DWORD threadId, ret;
rpcargs.returnValue = 0;
rpcargs.lastError = GetLastError();
@ -102,7 +102,8 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD
thread = CreateThread(NULL, 0, rpcThreadMain, (void *)&rpcargs, 0, &threadId);
ok(thread != NULL, "CreateThread failed. %d\n", GetLastError());
ok(WaitForSingleObject(thread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed with %d.\n", GetLastError());
ret = WaitForSingleObject(thread, INFINITE);
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with %d.\n", GetLastError());
CloseHandle(thread);
SetLastError(rpcargs.lastError);