kernel32/tests: Add a Process32(First,Next) test. (Win9X todo)

Florian Tobias Schandinat FlorianSchandinat at gmx.de
Wed Feb 4 16:34:08 CST 2009


---
 dlls/kernel32/tests/toolhelp.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c
index 529df88..91c2353 100644
--- a/dlls/kernel32/tests/toolhelp.c
+++ b/dlls/kernel32/tests/toolhelp.c
@@ -146,6 +146,22 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
     me.dwSize = sizeof(me);
     ok(!pModule32First( hSnapshot, &me ), "shouldn't return a module\n");
 
+    num = found = 0;
+    if (pProcess32First(hSnapshot, &pe))
+    {
+        do
+        {
+            num++;
+            if (strchr(pe.szExeFile, '\\')) found++;
+            trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile);
+        } while (pProcess32Next(hSnapshot, &pe));
+    }
+
+    if (GetVersion() & 0x80000000) /* Win 9X behaviour, needed by some apps */
+        todo_wine ok(num==found, "%d of %d processes did not contain the full name.\n", num-found, num);
+    else
+        ok(!found, "%d of %d processes did contain the full name.\n", found, num);
+
     CloseHandle(hSnapshot);
     ok(!pProcess32First( hSnapshot, &pe ), "shouldn't return a process\n");
 }
-- 
1.4.4.4


--------------000503070505060302080507--



More information about the wine-patches mailing list