-sync kernel32_winetest with wine 1.1.32

svn path=/trunk/; revision=43744
This commit is contained in:
Christoph von Wittich 2009-10-25 16:21:40 +00:00
parent 01a9e7493e
commit abc34f7dad
15 changed files with 451 additions and 295 deletions

View file

@ -34,6 +34,7 @@
static int myARGC;
static char** myARGV;
static BOOL (WINAPI *pCheckRemoteDebuggerPresent)(HANDLE,PBOOL);
static BOOL (WINAPI *pDebugActiveProcessStop)(DWORD);
static BOOL (WINAPI *pDebugSetProcessKillOnExit)(BOOL);
@ -283,6 +284,7 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
* detaching, then the debuggee gets a special exit code.
*/
ok(exit_code == STATUS_DEBUGGER_INACTIVE ||
broken(exit_code == STATUS_ACCESS_VIOLATION) || /* Intermittent Vista+ */
broken(exit_code == 0xffffffff) || /* Win9x */
broken(exit_code == WAIT_ABANDONED), /* NT4, W2K */
"wrong exit code : %08x\n", exit_code);
@ -433,11 +435,42 @@ static void test_ExitCode(void)
}
}
static void test_RemoteDebugger(void)
{
BOOL bret, present;
if(!pCheckRemoteDebuggerPresent)
{
win_skip("CheckRemoteDebuggerPresent is not available\n");
return;
}
present = TRUE;
SetLastError(0xdeadbeef);
bret = pCheckRemoteDebuggerPresent(GetCurrentProcess(),&present);
ok(bret , "expected CheckRemoteDebuggerPresent to succeed\n");
ok(0xdeadbeef == GetLastError(),
"expected error to be unchanged, got %d/%x\n",GetLastError(), GetLastError());
present = TRUE;
SetLastError(0xdeadbeef);
bret = pCheckRemoteDebuggerPresent(NULL,&present);
ok(!bret , "expected CheckRemoteDebuggerPresent to fail\n");
ok(present, "expected parameter to be unchanged\n");
ok(ERROR_INVALID_PARAMETER == GetLastError(),
"expected error ERROR_INVALID_PARAMETER, got %d/%x\n",GetLastError(), GetLastError());
SetLastError(0xdeadbeef);
bret = pCheckRemoteDebuggerPresent(GetCurrentProcess(),NULL);
ok(!bret , "expected CheckRemoteDebuggerPresent to fail\n");
ok(ERROR_INVALID_PARAMETER == GetLastError(),
"expected error ERROR_INVALID_PARAMETER, got %d/%x\n",GetLastError(), GetLastError());
}
START_TEST(debugger)
{
HMODULE hdll;
hdll=GetModuleHandle("kernel32.dll");
pCheckRemoteDebuggerPresent=(void*)GetProcAddress(hdll, "CheckRemoteDebuggerPresent");
pDebugActiveProcessStop=(void*)GetProcAddress(hdll, "DebugActiveProcessStop");
pDebugSetProcessKillOnExit=(void*)GetProcAddress(hdll, "DebugSetProcessKillOnExit");
@ -453,5 +486,6 @@ START_TEST(debugger)
else
{
test_ExitCode();
test_RemoteDebugger();
}
}