Alexandre Julliard : psapi/tests: Fix the working set tests for Wow64.

Alexandre Julliard julliard at winehq.org
Tue Jun 22 10:49:33 CDT 2010


Module: wine
Branch: master
Commit: 6cf16d723af29e37819e1f6c4b4a646ff404447b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6cf16d723af29e37819e1f6c4b4a646ff404447b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jun 22 12:55:23 2010 +0200

psapi/tests: Fix the working set tests for Wow64.

---

 dlls/psapi/tests/psapi_main.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c
index 21a3d1a..55eb937 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++)




More information about the wine-cvs mailing list