[PATCH 1/2] kernel32/tests: Add a test for loading manifest from resources.

Dmitry Timoshkov dmitry at baikal.ru
Fri Nov 12 07:49:47 CST 2021


To confirm that 2d764e90dd2c624f7a2d863ab29bd418ed33d252 does the right thing.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/kernel32/tests/actctx.c           | 32 ++++++++++++++++++++++++--
 dlls/kernel32/tests/resource.rc        |  2 ++
 dlls/kernel32/tests/wine_test.manifest |  4 ++++
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 dlls/kernel32/tests/wine_test.manifest

diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 163ea405222..adf2549bece 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -694,7 +694,7 @@ static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int
         ok_(__FILE__, line)(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n");
         if(detailed_info->lpRootManifestPath)
             ok_(__FILE__, line)(!lstrcmpiW(detailed_info->lpRootManifestPath, exinfo->root_manifest_path),
-               "unexpected detailed_info->lpRootManifestPath\n");
+               "unexpected detailed_info->lpRootManifestPath %s\n", wine_dbgstr_w(detailed_info->lpRootManifestPath));
     }else {
         ok_(__FILE__, line)(detailed_info->lpRootManifestPath == NULL, "detailed_info->lpRootManifestPath != NULL\n");
     }
@@ -2683,7 +2683,8 @@ todo_wine
     SetLastError(0xdeadbeef);
     handle = CreateActCtxA(&actctx);
     ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
-    ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "got error %d\n", GetLastError());
+todo_wine
+    ok(GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "got error %d\n", GetLastError());
 
     /* load manifest from lpAssemblyDirectory directory */
     write_manifest("testdir.manifest", manifest1);
@@ -3548,6 +3549,32 @@ static void run_child_process_two_dll(int run)
     CloseHandle(pi.hProcess);
 }
 
+static const detailed_info_t detailed_info3 =
+{
+    1, 1, 1, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, exe_path,
+    ACTIVATION_CONTEXT_PATH_TYPE_NONE, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
+    app_dir,
+};
+
+static void test_manifest_in_module(void)
+{
+    ACTCTXW ctx;
+    HANDLE handle;
+
+    memset(&ctx, 0, sizeof(ctx));
+    ctx.cbSize = sizeof(ctx);
+    ctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID;
+    ctx.lpResourceName = (LPWSTR)124;
+    ctx.hModule = GetModuleHandleW(NULL);
+    handle = CreateActCtxW(&ctx);
+    ok(handle != 0, "CreateActCtx error %u\n", GetLastError());
+
+    test_basic_info(handle, __LINE__);
+    test_detailed_info(handle, &detailed_info3, __LINE__);
+
+    ReleaseActCtx(handle);
+}
+
 START_TEST(actctx)
 {
     int argc;
@@ -3574,6 +3601,7 @@ START_TEST(actctx)
         return;
     }
 
+    test_manifest_in_module();
     test_actctx();
     test_create_fail();
     test_CreateActCtx();
diff --git a/dlls/kernel32/tests/resource.rc b/dlls/kernel32/tests/resource.rc
index f40a87819ea..58902e7a015 100644
--- a/dlls/kernel32/tests/resource.rc
+++ b/dlls/kernel32/tests/resource.rc
@@ -24,3 +24,5 @@
 {
     MENUITEM "foo", 1
 }
+
+124 24 wine_test.manifest
diff --git a/dlls/kernel32/tests/wine_test.manifest b/dlls/kernel32/tests/wine_test.manifest
new file mode 100644
index 00000000000..de77de3e201
--- /dev/null
+++ b/dlls/kernel32/tests/wine_test.manifest
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <assemblyIdentity version="1.0.0.0" name="Wine.Test"/>
+</assembly>
-- 
2.33.1




More information about the wine-devel mailing list