diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index cef11a5e631..263fe3997cb 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -426,9 +426,9 @@ static const char compat_manifest_vista_7_8_10_81[] =
" "
" "
" "
-" " /* Windows Vista */
+" " /* Windows Vista */
" " /* Windows 7 */
-" " /* Windows 8 */
+" " /* Windows 8 */
" " /* Windows 10 */
" " /* Windows 8.1 */
" "
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 4a3370048fa..27d6ad864c0 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -2245,11 +2245,50 @@ static BOOL parse_file_elem(xmlbuf_t* xmlbuf, struct assembly* assembly, struct
return ret;
}
+static BOOL parse_supportedos_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
+{
+ xmlstr_t attr_name, attr_value;
+ BOOL end = FALSE, error;
+
+ while (next_xml_attr(xmlbuf, &attr_name, &attr_value, &error, &end))
+ {
+ if (xmlstr_cmp(&attr_name, IdW))
+ {
+ COMPATIBILITY_CONTEXT_ELEMENT *compat;
+ UNICODE_STRING str;
+ GUID compat_id;
+
+ str.Buffer = (PWSTR)attr_value.ptr;
+ str.Length = str.MaximumLength = (USHORT)attr_value.len * sizeof(WCHAR);
+ if (RtlGUIDFromString(&str, &compat_id) == STATUS_SUCCESS)
+ {
+ if (!(compat = add_compat_context(assembly))) return FALSE;
+ compat->Type = ACTCX_COMPATIBILITY_ELEMENT_TYPE_OS;
+ compat->Id = compat_id;
+ }
+ else
+ {
+ WARN("Invalid guid %s\n", debugstr_xmlstr(&attr_value));
+ }
+ }
+ else
+ {
+ WARN("unknown attr %s=%s\n", debugstr_xmlstr(&attr_name),
+ debugstr_xmlstr(&attr_value));
+ }
+ }
+
+ if (error) return FALSE;
+ if (end) return TRUE;
+
+ return parse_expect_end_elem(xmlbuf, supportedOSW, asmv1W);
+}
+
static BOOL parse_compatibility_application_elem(xmlbuf_t* xmlbuf, struct assembly* assembly,
struct actctx_loader* acl)
{
- xmlstr_t attr_name, attr_value, elem;
- BOOL end = FALSE, ret = TRUE, error;
+ BOOL ret = TRUE;
+ xmlstr_t elem;
while (ret && (ret = next_xml_elem(xmlbuf, &elem)))
{
@@ -2260,32 +2299,7 @@ static BOOL parse_compatibility_application_elem(xmlbuf_t* xmlbuf, struct assemb
}
else if (xmlstr_cmp(&elem, supportedOSW))
{
- while (next_xml_attr(xmlbuf, &attr_name, &attr_value, &error, &end))
- {
- if (xmlstr_cmp(&attr_name, IdW))
- {
- UNICODE_STRING str;
- COMPATIBILITY_CONTEXT_ELEMENT* compat;
- GUID compat_id;
- str.Buffer = (PWSTR)attr_value.ptr;
- str.Length = str.MaximumLength = (USHORT)attr_value.len * sizeof(WCHAR);
- if (RtlGUIDFromString(&str, &compat_id) == STATUS_SUCCESS)
- {
- if (!(compat = add_compat_context(assembly))) return FALSE;
- compat->Type = ACTCX_COMPATIBILITY_ELEMENT_TYPE_OS;
- compat->Id = compat_id;
- }
- else
- {
- WARN("Invalid guid %s\n", debugstr_xmlstr(&attr_value));
- }
- }
- else
- {
- WARN("unknown attr %s=%s\n", debugstr_xmlstr(&attr_name),
- debugstr_xmlstr(&attr_value));
- }
- }
+ ret = parse_supportedos_elem(xmlbuf, assembly, acl);
}
else
{