[Bug 23772] The bug in NtQueryInformationProcess with ProcessInformationClass = ProcessDebugObjectHandle

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jul 25 06:31:11 CDT 2010


http://bugs.winehq.org/show_bug.cgi?id=23772





--- Comment #4 from Ivan Permyakov <info at vmpsoft.com>  2010-07-25 06:31:09 ---
------------ first diff ------------

diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 6fdceae..fb8bc3b 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -327,7 +327,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
             else if (!ProcessHandle)
                 ret = STATUS_INVALID_HANDLE;
             else
-                memset(ProcessInformation, 0, ProcessInformationLength);
+                ret = STATUS_PORT_NOT_SET; /* Windows doesn't clean the
ProcessInformation field here */
         }
         else
             ret = STATUS_INFO_LENGTH_MISMATCH;

------------ second diff ------------

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 13c29f8..8b77419 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -837,6 +837,18 @@ static void test_query_process_debug_port(int argc, char
**argv)
     ok(ret, "CloseHandle failed, last error %#x.\n", GetLastError());
 }

+static void test_query_process_debug_object_handle(int argc, char **argv)
+{
+    HANDLE debug_handle = 0xdeadbeef;
+    NTSTATUS status;
+
+    status = pNtQueryInformationProcess(GetCurrentProcess(),
ProcessDebugObjectHandle,
+            &debug_handle, sizeof(debug_handle), NULL);
+
+    ok(status == STATUS_PORT_NOT_SET, "NtQueryInformationProcess failed,
status %#x.\n", status);
+    ok(debug_handle == 0xdeadbeef, "Expected handle 0xdeadbeef, got %#lx.\n",
debug_handle);
+}
+
 static void test_query_process_handlecount(void)
 {
     NTSTATUS status;
@@ -1198,6 +1210,10 @@ START_TEST(info)
     trace("Starting test_process_debug_port()\n");
     test_query_process_debug_port(argc, argv);

+    /* 0x1E ProcessDebugObjectHandle */
+    trace("Starting test_query_process_debug_object_handle()\n");
+    test_query_process_debug_object_handle(argc, argv)
+
     /* 0x14 ProcessHandleCount */
     trace("Starting test_query_process_handlecount()\n");
     test_query_process_handlecount();

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list