[PATCH v2 0/1] MR3888: ntdll: Allow empty application nodes in actctx.
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> -- v2: ntdll: Allow empty application nodes in actctx. https://gitlab.winehq.org/wine/wine/-/merge_requests/3888
From: Eric Pouech <epouech(a)codeweavers.com> Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/kernel32/tests/actctx.c | 23 +++++++++++++++++++++++ dlls/ntdll/actctx.c | 9 +++++++++ 2 files changed, 32 insertions(+) diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index d468777ac2f..a52f410d5ec 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -511,6 +511,18 @@ static const char settings_manifest3[] = " </asmv3:application>" "</assembly>"; +static const char settings_manifest4[] = +"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">" +" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>" +" <application/>" +" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">" +" <windowsSettings>" +" <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>" +" <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">true</dpiAwareness>" +" </windowsSettings>" +" </application>" +"</assembly>"; + static const char two_dll_manifest_dll[] = "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v3\" manifestVersion=\"1.0\">" " <assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\" processorArchitecture=\"x86\" publicKeyToken=\"0000000000000000\"/>" @@ -3405,6 +3417,17 @@ static void test_settings(void) ok( !ret, "QueryActCtxSettingsW succeeded\n" ); ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ReleaseActCtx(handle); + + create_manifest_file( "manifest_settings4.manifest", settings_manifest4, -1, NULL, NULL ); + handle = test_create("manifest_settings4.manifest"); + ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() ); + DeleteFileA( "manifest_settings3.manifest" ); + SetLastError( 0xdeadbeef ); + size = 0xdead; + memset( buffer, 0xcc, sizeof(buffer) ); + ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size ); + ok( ret, "QueryActCtxSettingsW succeeded\n" ); + ReleaseActCtx(handle); } typedef struct diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 9f2c1d54720..d08519b83b8 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2564,6 +2564,15 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent ) { struct xml_elem elem; + struct xml_attr attr; + BOOL end = FALSE; + + while (next_xml_attr(xmlbuf, &attr, &end)) + { + if (!is_xmlns_attr( &attr )) WARN( "unknown attr %s\n", debugstr_xml_attr(&attr) ); + } + + if (end) return; while (next_xml_elem( xmlbuf, &elem, parent )) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3888
On Tue Sep 19 13:20:28 2023 +0000, Nikolay Sivov wrote:
Additional test would be to have two or more non-empty <application> elements. I don't think it's blocking for this fix. extended manifest with 2 non-empty application nodes intertwined with empty ones... showing that lookup only happens in first non empty one
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3888#note_45879
On Tue Sep 19 13:20:41 2023 +0000, Nikolay Sivov wrote:
The message should say "failed", or "unexpected", because it's supposed to succeed. done (V3)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3888#note_45880
On Tue Sep 19 11:51:54 2023 +0000, eric pouech wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/3888/diffs?diff_id=70214&start_sha=789018e03f50f1026597b0749cd4afa50b982ffa#13c82877dce764401d4d24e08dcaead56b81f944_2571_2571) done (V2)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3888#note_45881
participants (2)
-
Eric Pouech -
eric pouech (@epo)