ntdll: also parse asmv1 assemblies (with test)
André Hentschel
nerv at dawncrow.de
Mon Jul 19 12:08:57 CDT 2010
needed for the installer of Flir QuickPlot Demo
this time with a test
---
dlls/kernel32/tests/actctx.c | 32 ++++++++++++++++++++++++++++++++
dlls/ntdll/actctx.c | 7 ++++---
2 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index a158cf3..d15e43d 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -90,6 +90,18 @@ static const char manifest4[] =
"</dependency>"
"</assembly>";
+static const char manifest5[] =
+"<asmv1:assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
+"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
+"</assemblyIdentity>"
+"<dependency>"
+"<dependentAssembly>"
+"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\">"
+"</assemblyIdentity>"
+"</dependentAssembly>"
+"</dependency>"
+"</asmv1:assembly>";
+
static const char testdep_manifest1[] =
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\"/>"
@@ -689,6 +701,8 @@ static void test_create_fail(void)
test_create_wide_and_fail(manifest1, FALSE );
trace("manifest2\n");
test_create_and_fail(manifest2, NULL, 0 );
+ trace("manifest5\n");
+ test_create_and_fail(manifest5, NULL, 0 );
trace("manifest2+depmanifest1\n");
test_create_and_fail(manifest2, wrong_depmanifest1, 0 );
}
@@ -1116,6 +1130,24 @@ static void test_actctx(void)
pReleaseActCtx(handle);
}
+ if(!create_manifest_file("test5.manifest", manifest5, -1, "testdep.manifest", testdep_manifest1)) {
+ skip("Could not create manifest file\n");
+ return;
+ }
+
+ trace("manifest5 depmanifest1\n");
+
+ handle = test_create("test5.manifest", manifest5);
+ DeleteFileA("test5.manifest");
+ DeleteFileA("testdep.manifest");
+ if(handle != INVALID_HANDLE_VALUE) {
+ /* manifest5 should have the same infos as manifest2 */
+ test_basic_info(handle, __LINE__);
+ test_detailed_info(handle, &detailed_info2, __LINE__);
+ test_info_in_assembly(handle, 1, &manifest2_info, __LINE__);
+ test_info_in_assembly(handle, 2, &depmanifest1_info, __LINE__);
+ pReleaseActCtx(handle);
+ }
}
static void test_app_manifest(void)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index a1b1e3b..b3a222a 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -182,6 +182,7 @@ struct actctx_loader
};
static const WCHAR assemblyW[] = {'a','s','s','e','m','b','l','y',0};
+static const WCHAR asmv1assemblyW[] = {'a', 's', 'm', 'v', '1', ':', 'a', 's', 's', 'e', 'm', 'b', 'l', 'y', 0};
static const WCHAR assemblyIdentityW[] = {'a','s','s','e','m','b','l','y','I','d','e','n','t','i','t','y',0};
static const WCHAR bindingRedirectW[] = {'b','i','n','d','i','n','g','R','e','d','i','r','e','c','t',0};
static const WCHAR clrClassW[] = {'c','l','r','C','l','a','s','s',0};
@@ -1392,7 +1393,7 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl,
while (ret)
{
- if (xmlstr_cmp_end(&elem, assemblyW))
+ if (xmlstr_cmp_end(&elem, assemblyW) || xmlstr_cmp_end(&elem, asmv1assemblyW))
{
ret = parse_end_element(xmlbuf);
break;
@@ -1472,9 +1473,9 @@ static NTSTATUS parse_manifest_buffer( struct actctx_loader* acl, struct assembl
(!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem)))
return STATUS_SXS_CANT_GEN_ACTCTX;
- if (!xmlstr_cmp(&elem, assemblyW))
+ if (!xmlstr_cmp(&elem, assemblyW) && !xmlstr_cmp(&elem, asmv1assemblyW))
{
- FIXME("root element is %s, not <assembly>\n", debugstr_xmlstr(&elem));
+ FIXME("root element is %s, not <assembly> or <asmv1:assembly>\n", debugstr_xmlstr(&elem));
return STATUS_SXS_CANT_GEN_ACTCTX;
}
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list