Zebediah Figura : ntdll/tests: Add a test for ProcessImageFileNameWin32.

Alexandre Julliard julliard at winehq.org
Mon Mar 5 16:14:32 CST 2018


Module: wine
Branch: master
Commit: 08cc41459b2ba05b931732557d6ebe96be5fb2af
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=08cc41459b2ba05b931732557d6ebe96be5fb2af

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun Mar  4 10:20:06 2018 -0600

ntdll/tests: Add a test for ProcessImageFileNameWin32.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/info.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 75afd76..6c93c3c 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1444,6 +1444,28 @@ todo_wine
         "Expected image name to begin with \\Device\\, got %s\n",
         wine_dbgstr_wn(buffer->Buffer, buffer->Length / sizeof(WCHAR)));
     heap_free(buffer);
+
+    status = pNtQueryInformationProcess(NULL, ProcessImageFileNameWin32, &image_file_name, sizeof(image_file_name), NULL);
+    if (status == STATUS_INVALID_INFO_CLASS)
+    {
+        win_skip("ProcessImageFileNameWin32 is not supported\n");
+        return;
+    }
+    ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
+
+    status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileNameWin32, &image_file_name, 2, &ReturnLength);
+    ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
+
+    status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileNameWin32, &image_file_name, sizeof(image_file_name), &ReturnLength);
+    ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
+
+    buffer = heap_alloc(ReturnLength);
+    status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileNameWin32, buffer, ReturnLength, &ReturnLength);
+    ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
+    ok(memcmp(buffer->Buffer, deviceW, sizeof(deviceW)),
+        "Expected image name not to begin with \\Device\\, got %s\n",
+        wine_dbgstr_wn(buffer->Buffer, buffer->Length / sizeof(WCHAR)));
+    heap_free(buffer);
 }
 
 static void test_query_process_debug_object_handle(int argc, char **argv)




More information about the wine-cvs mailing list