[PATCH 16/27] [Kernel32]: ActCtx: now parsing the inheritance flags
Eric Pouech
eric.pouech at wanadoo.fr
Mon May 7 14:51:25 CDT 2007
---
dlls/kernel32/actctx.c | 40 +++++++++++++++++++++++++++++++++++++---
1 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/actctx.c b/dlls/kernel32/actctx.c
index f12f0d0..d8cee78 100644
--- a/dlls/kernel32/actctx.c
+++ b/dlls/kernel32/actctx.c
@@ -144,6 +144,7 @@ struct assembly
enum assembly_type type;
struct assembly_identity id;
struct file_info manifest;
+ BOOL no_inherit;
struct dll_redirect*dlls;
unsigned num_dlls;
unsigned num_entities;
@@ -227,6 +228,7 @@ static struct assembly* add_assembly(struct actctx* actctx, enum assembly_type a
assembly->num_entities = 0;
assembly->entities = NULL;
memset(&assembly->id, 0, sizeof(assembly->id));
+ assembly->no_inherit = FALSE;
assembly->num_dlls = 0;
assembly->dlls = 0;
@@ -394,6 +396,8 @@ done:
#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"
@@ -887,10 +891,7 @@ static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf,
if (!parse_expect_elem(xmlbuf, ASSEMBLYIDENTITY_ELEM) ||
!parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai))
- {
- ERR("!!\n");
return FALSE;
- }
/* store the newly found identity for later loading */
if (!add_dependent_assembly_id(acl, &ai)) return FALSE;
@@ -942,6 +943,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_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl,
struct assembly* assembly,
struct assembly_identity* expected_ai)
@@ -983,6 +1002,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));
More information about the wine-patches
mailing list