Module: wine Branch: master Commit: 61582576515b20757eea444fb2c16f966c6c0a8c URL: http://source.winehq.org/git/wine.git/?a=commit;h=61582576515b20757eea444fb2...
Author: Eric Pouech eric.pouech@wanadoo.fr Date: Thu Jul 19 17:57:38 2007 +0200
ntdll: Added parsing of the inheritance flags in manifests.
---
dlls/ntdll/actctx.c | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 0e2ab50..1f60767 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -141,6 +141,7 @@ struct assembly enum assembly_type type; struct assembly_identity id; struct file_info manifest; + BOOL no_inherit; struct dll_redirect *dlls; unsigned int num_dlls; unsigned int allocated_dlls; @@ -172,6 +173,8 @@ struct actctx_loader #define DEPENDENCY_ELEM "dependency" #define DEPENDENTASSEMBLY_ELEM "dependentAssembly" #define FILE_ELEM "file" +#define NOINHERIT_ELEM "noInherit" +#define NOINHERITABLE_ELEM "noInheritable" #define TYPELIB_ELEM "typelib" #define WINDOWCLASS_ELEM "windowClass"
@@ -837,6 +840,24 @@ static BOOL parse_dependency_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl) return ret; }
+static BOOL parse_noinherit_elem(xmlbuf_t* xmlbuf) +{ + BOOL end = FALSE; + + if (!parse_expect_no_attr(xmlbuf, &end)) return FALSE; + return end || + (parse_expect_elem(xmlbuf, ELEM_END(NOINHERIT_ELEM)) && parse_end_element(xmlbuf)); +} + +static BOOL parse_noinheritable_elem(xmlbuf_t* xmlbuf) +{ + BOOL end = FALSE; + + if (!parse_expect_no_attr(xmlbuf, &end)) return FALSE; + return end || + (parse_expect_elem(xmlbuf, ELEM_END(NOINHERITABLE_ELEM)) && parse_end_element(xmlbuf)); +} + static BOOL parse_file_elem(xmlbuf_t* xmlbuf, struct assembly* assembly) { xmlstr_t attr_name, attr_value, elem; @@ -946,6 +967,21 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, if (error || end || !xmlns || !version) return FALSE; if (!next_xml_elem(xmlbuf, &elem)) return FALSE;
+ if (assembly->type == APPLICATION_MANIFEST && xmlstr_cmp(&elem, NOINHERIT_ELEM)) + { + if (!parse_noinherit_elem(xmlbuf) || !next_xml_elem(xmlbuf, &elem)) + return FALSE; + assembly->no_inherit = TRUE; + } + + if (xmlstr_cmp(&elem, NOINHERITABLE_ELEM)) + { + if (!parse_noinheritable_elem(xmlbuf) || !next_xml_elem(xmlbuf, &elem)) + return FALSE; + } + else if (assembly->type == ASSEMBLY_MANIFEST && assembly->no_inherit) + return FALSE; + if (!xmlstr_cmp(&elem, ASSEMBLYIDENTITY_ELEM)) { WARN("expected assemblyIdentity element, got %s\n", debugstr_xmlstr(&elem));