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
+ {
+ UNICODE_STRING attr_valueU = xmlstr2unicode(&attr_value);
+ DPRINT1("Invalid guid %wZ\n", &attr_valueU);
+ }
+ }
+ else
+ {
+ UNICODE_STRING attr_nameU = xmlstr2unicode(&attr_name);
+ UNICODE_STRING attr_valueU = xmlstr2unicode(&attr_value);
+ DPRINT1("unknown attr %wZ=%wZ\n", &attr_nameU, &attr_valueU);
+ }
+ }
+
+ 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)))
{
}
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
- {
- UNICODE_STRING attr_valueU = xmlstr2unicode(&attr_value);
- DPRINT1("Invalid guid %wZ\n", &attr_valueU);
- }
- }
- else
- {
- UNICODE_STRING attr_nameU = xmlstr2unicode(&attr_name);
- UNICODE_STRING attr_valueU = xmlstr2unicode(&attr_value);
- DPRINT1("unknown attr %wZ=%wZ\n", &attr_nameU, &attr_valueU);
- }
- }
+ ret = parse_supportedos_elem(xmlbuf, assembly, acl);
}
else
{
while (ret && (ret = next_xml_elem(xmlbuf, &elem)))
{
- if (xmlstr_cmp_end(&elem, requestedExecutionLevelW))
+ if (xml_elem_cmp_end(&elem, requestedExecutionLevelW, asmv2W))
{
ret = parse_end_element(xmlbuf);
break;
while (ret && (ret = next_xml_elem(xmlbuf, &elem)))
{
- if (xmlstr_cmp_end(&elem, requestedPrivilegesW))
+ if (xml_elem_cmp_end(&elem, requestedPrivilegesW, asmv2W))
{
ret = parse_end_element(xmlbuf);
break;
}
- else if (xmlstr_cmp(&elem, requestedExecutionLevelW))
+ else if (xml_elem_cmp(&elem, requestedExecutionLevelW, asmv2W))
ret = parse_requested_execution_level_elem(xmlbuf, assembly, acl);
else
{
while (ret && (ret = next_xml_elem(xmlbuf, &elem)))
{
- if (xmlstr_cmp_end(&elem, securityW))
+ if (xml_elem_cmp_end(&elem, securityW, asmv2W))
{
ret = parse_end_element(xmlbuf);
break;
}
- else if (xmlstr_cmp(&elem, requestedPrivilegesW))
+ else if (xml_elem_cmp(&elem, requestedPrivilegesW, asmv2W))
ret = parse_requested_privileges_elem(xmlbuf, assembly, acl);
else
{
while (ret && (ret = next_xml_elem(xmlbuf, &elem)))
{
- if (xmlstr_cmp_end(&elem, trustInfoW))
+ if (xml_elem_cmp_end(&elem, trustInfoW, asmv2W))
{
ret = parse_end_element(xmlbuf);
break;
}
- else if (xmlstr_cmp(&elem, securityW))
+ else if (xml_elem_cmp(&elem, securityW, asmv2W))
ret = parse_security_elem(xmlbuf, assembly, acl);
else
{