From 6cf16d723af29e37819e1f6c4b4a646ff404447b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 22 Jun 2010 12:55:23 +0200 Subject: [PATCH] psapi/tests: Fix the working set tests for Wow64. --- dlls/psapi/tests/psapi_main.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 21a3d1aa269..55eb9377c54 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -275,23 +275,36 @@ static void test_ws_functions(void) ULONG_PTR pages[4096]; char *addr; unsigned int i; - + BOOL ret; + todo_wine w32_err(pEmptyWorkingSet(NULL), ERROR_INVALID_HANDLE); todo_wine w32_err(pEmptyWorkingSet(hpSR), ERROR_ACCESS_DENIED); w32_suc(pEmptyWorkingSet(hpAA)); - - todo_wine w32_err(pInitializeProcessForWsWatch(NULL), ERROR_INVALID_HANDLE); + + SetLastError( 0xdeadbeef ); + ret = pInitializeProcessForWsWatch( NULL ); + todo_wine ok( !ret, "InitializeProcessForWsWatch succeeded\n" ); + if (!ret) + { + if (GetLastError() == ERROR_INVALID_FUNCTION) /* not supported on xp in wow64 mode */ + { + trace( "InitializeProcessForWsWatch not supported\n" ); + return; + } + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + } w32_suc(pInitializeProcessForWsWatch(hpAA)); if(!w32_suc(addr = VirtualAlloc(NULL, 1, MEM_COMMIT, PAGE_READWRITE))) return; + *addr = 0; /* make sure it's paged in (needed on wow64) */ if(!VirtualLock(addr, 1)) { trace("locking failed (error=%d) - skipping test\n", GetLastError()); goto free_page; } - + todo_wine if(w32_suc(pQueryWorkingSet(hpQI, pages, 4096 * sizeof(ULONG_PTR)))) { for(i = 0; i < pages[0]; i++)