=?UTF-8?Q?Michael=20M=C3=BCller=20?=: ntdll: Implement ProcessImageFileNameWin32 in NtQueryInformationProcess.

Alexandre Julliard julliard at winehq.org
Sun Mar 3 13:21:26 CST 2019


Module: wine
Branch: oldstable
Commit: be7b218c8c236b84d7971bdeee7717b3e9f8a06f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=be7b218c8c236b84d7971bdeee7717b3e9f8a06f

Author: Michael Müller <michael at fds-team.de>
Date:   Sun Mar  4 10:20:04 2018 -0600

ntdll: Implement ProcessImageFileNameWin32 in NtQueryInformationProcess.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 69029d70f6c712b46dbc82703093db4042082b61)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/kernel32/tests/process.c | 16 ++++++++++------
 dlls/ntdll/process.c          |  4 ++--
 include/winternl.h            |  9 +++++++++
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index b5c8fc5..e7e3ca3 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -3461,16 +3461,16 @@ static void test_process_info(void)
         sizeof(buf) /* ProcessHandleTracing */,
         sizeof(ULONG) /* ProcessIoPriority */,
         sizeof(ULONG) /* ProcessExecuteFlags */,
-#if 0 /* FIXME: Add remaining classes */
-        ProcessResourceManagement,
-        sizeof(ULONG) /* ProcessCookie */,
+        0 /* FIXME: sizeof(?) ProcessTlsInformation */,
+        0 /* FIXME: sizeof(?) ProcessCookie */,
         sizeof(SECTION_IMAGE_INFORMATION) /* ProcessImageInformation */,
-        sizeof(PROCESS_CYCLE_TIME_INFORMATION) /* ProcessCycleTime */,
+        0 /* FIXME: sizeof(PROCESS_CYCLE_TIME_INFORMATION) ProcessCycleTime */,
         sizeof(ULONG) /* ProcessPagePriority */,
         40 /* ProcessInstrumentationCallback */,
-        sizeof(PROCESS_STACK_ALLOCATION_INFORMATION) /* ProcessThreadStackAllocation */,
-        sizeof(PROCESS_WS_WATCH_INFORMATION_EX[]) /* ProcessWorkingSetWatchEx */,
+        0 /* FIXME: sizeof(PROCESS_STACK_ALLOCATION_INFORMATION) ProcessThreadStackAllocation */,
+        0 /* FIXME: sizeof(PROCESS_WS_WATCH_INFORMATION_EX[]) ProcessWorkingSetWatchEx */,
         sizeof(buf) /* ProcessImageFileNameWin32 */,
+#if 0 /* FIXME: Add remaining classes */
         sizeof(HANDLE) /* ProcessImageFileMapping */,
         sizeof(PROCESS_AFFINITY_UPDATE_MODE) /* ProcessAffinityUpdateMode */,
         sizeof(PROCESS_MEMORY_ALLOCATION_MODE) /* ProcessMemoryAllocationMode */,
@@ -3542,6 +3542,9 @@ static void test_process_info(void)
         case ProcessDefaultHardErrorMode:
         case ProcessHandleCount:
         case ProcessImageFileName:
+        case ProcessImageInformation:
+        case ProcessPagePriority:
+        case ProcessImageFileNameWin32:
             ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len);
             break;
 
@@ -3559,6 +3562,7 @@ static void test_process_info(void)
         case ProcessExecuteFlags:
         case ProcessDebugPort:
         case ProcessDebugFlags:
+        case ProcessCookie:
 todo_wine
             ok(status == STATUS_ACCESS_DENIED, "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len);
             break;
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 7f3005f..a0db5c3 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -515,8 +515,8 @@ NTSTATUS WINAPI NtQueryInformationProcess(
         }
         break;
     case ProcessImageFileName:
-        /* FIXME: this will return a DOS path. Windows returns an NT path. Changing this would require also changing kernel32.QueryFullProcessImageName.
-         * The latter may be harder because of the lack of RtlNtPathNameToDosPathName. */
+        /* FIXME: Should return a device path */
+    case ProcessImageFileNameWin32:
         SERVER_START_REQ(get_dll_info)
         {
             UNICODE_STRING *image_file_name_str = ProcessInformation;
diff --git a/include/winternl.h b/include/winternl.h
index d5aee67..d4ef5c0 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -824,6 +824,15 @@ typedef enum _PROCESSINFOCLASS {
     ProcessDebugFlags = 31,
     ProcessHandleTracing = 32,
     ProcessExecuteFlags = 34,
+    ProcessTlsInformation = 35,
+    ProcessCookie = 36,
+    ProcessImageInformation = 37,
+    ProcessCycleTime = 38,
+    ProcessPagePriority = 39,
+    ProcessInstrumentationCallback = 40,
+    ProcessThreadStackAllocation = 41,
+    ProcessWorkingSetWatchEx = 42,
+    ProcessImageFileNameWin32 = 43,
     MaxProcessInfoClass
 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
 




More information about the wine-cvs mailing list