Module: wine
Branch: refs/heads/master
Commit: c2a2687dd89cf72059fab0944f4497818056a939
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=c2a2687dd89cf72059fab09…
Author: Paul Vriens <Paul.Vriens(a)xs4all.nl>
Date: Tue May 16 21:19:40 2006 +0200
ntdll/tests: Don't fail if a process is not available.
---
dlls/ntdll/tests/info.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index e5bb9b4..12c6fb3 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -729,7 +729,15 @@ static void test_query_process_handlecou
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status);
process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, one_before_last_pid);
- trace("Handlecount for process with ID : %ld\n", one_before_last_pid);
+ if (!process)
+ {
+ trace("Could not open process with ID : %ld, error : %08lx. Going to use current one.\n", one_before_last_pid, GetLastError());
+ process = GetCurrentProcess();
+ trace("ProcessHandleCount for current process\n");
+ }
+ else
+ trace("ProcessHandleCount for process with ID : %ld\n", one_before_last_pid);
+
status = pNtQueryInformationProcess( process, ProcessHandleCount, &handlecount, sizeof(handlecount), &ReturnLength);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status);
ok( sizeof(handlecount) == ReturnLength, "Inconsistent length (%d) <-> (%ld)\n", sizeof(handlecount), ReturnLength);