Module: wine
Branch: master
Commit: 4718261e9b78f1d16a94644003d0a01ae3b38f8d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4718261e9b78f1d16a9464400…
Author: Michael Stefaniuc <mstefani(a)redhat.de>
Date: Fri Apr 6 00:49:18 2007 +0200
msvcrt: Move the code to demangle a name with its template argument list out of get_class() and into a separate function.
---
dlls/msvcrt/undname.c | 52 ++++++++++++++++++++++++++++--------------------
1 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index a775e72..da4aeb0 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -427,6 +427,35 @@ static char* get_literal_string(struct parsed_symbol* sym)
}
/******************************************************************
+ * get_template_name
+ * Parses a name with a template argument list and returns it as
+ * a string.
+ * In a template argument list the back reference to the names
+ * table is separately created. '0' points to the class component
+ * name with the template arguments. We use the same stack array
+ * to hold the names but save/restore the stack state before/after
+ * parsing the template argument list.
+ */
+static char* get_template_name(struct parsed_symbol* sym)
+{
+ char *name, *args;
+ unsigned num_mark = sym->names.num;
+ unsigned start_mark = sym->names.start;
+ unsigned stack_mark = sym->stack.num;
+
+ sym->names.start = sym->names.num;
+ if (!(name = get_literal_string(sym)))
+ return FALSE;
+ args = get_args(sym, NULL, FALSE, '<', '>');
+ if (args != NULL)
+ name = str_printf(sym, "%s%s", name, args);
+ sym->names.num = num_mark;
+ sym->names.start = start_mark;
+ sym->stack.num = stack_mark;
+ return name;
+}
+
+/******************************************************************
* get_class
* Parses class as a list of parent-classes, terminated by '@' and stores the
* result in 'a' array. Each parent-classes, as well as the inner element
@@ -457,29 +486,8 @@ static BOOL get_class(struct parsed_symbol* sym)
case '?':
if (*++sym->current == '$')
{
- /* In a template argument list the back reference to names
- table is separately created. '0' points to the class
- component name with the template arguments. We use the same
- stack array to hold the names but save/restore the stack
- state before/after parsing the template argument list. */
- char* args = NULL;
- unsigned num_mark = sym->names.num;
- unsigned start_mark = sym->names.start;
- unsigned stack_mark = sym->stack.num;
-
- sym->names.start = sym->names.num;
sym->current++;
- if (!(name = get_literal_string(sym)))
- return FALSE;
- args = get_args(sym, NULL, FALSE, '<', '>');
- if (args != NULL)
- name = str_printf(sym, "%s%s", name, args);
- sym->names.num = num_mark;
- sym->names.start = start_mark;
- sym->stack.num = stack_mark;
- /* Now that we are back to the standard name scope push
- the class component with all its template arguments
- to the names array for back reference. */
+ name = get_template_name(sym);
str_array_push(sym, name, -1, &sym->names);
}
break;
Module: wine
Branch: master
Commit: 1360357f92ac6bda3c1802870fbe9a45de2fe146
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1360357f92ac6bda3c1802870…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Thu Apr 5 17:33:36 2007 +0100
ole32: Fix a hack which depended on the IID of the interface being marshaled
to determine whether we were marshaling the remote unknown for the
apartment or not.
---
dlls/ole32/compobj_private.h | 3 +++
dlls/ole32/stubmanager.c | 4 ++--
dlls/ole32/tests/marshal.c | 5 -----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index 401224a..e877cce 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -45,6 +45,9 @@ DEFINE_OLEGUID( CLSID_DfMarshal, 0x0000030b, 0, 0 );
DEFINE_OLEGUID( CLSID_PSFactoryBuffer, 0x00000320, 0, 0 );
DEFINE_OLEGUID( CLSID_InProcFreeMarshaler, 0x0000033a, 0, 0 );
+/* signal to stub manager that this is a rem unknown object */
+#define MSHLFLAGSP_REMUNKNOWN 0x80000000
+
/* Thread-safety Annotation Legend:
*
* RO - The value is read only. It never changes after creation, so no
diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c
index b7d6ba7..76e07a2 100644
--- a/dlls/ole32/stubmanager.c
+++ b/dlls/ole32/stubmanager.c
@@ -471,7 +471,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
/* FIXME: find a cleaner way of identifying that we are creating an ifstub
* for the remunknown interface */
- if (IsEqualIID(iid, &IID_IRemUnknown))
+ if (flags & MSHLFLAGSP_REMUNKNOWN)
stub->ipid = m->oxid_info.ipidRemUnknown;
else
generate_ipid(m, &stub->ipid);
@@ -763,7 +763,7 @@ HRESULT start_apartment_remote_unknown(void)
{
STDOBJREF stdobjref; /* dummy - not used */
/* register it with the stub manager */
- hr = marshal_object(apt, &stdobjref, &IID_IRemUnknown, (IUnknown *)pRemUnknown, MSHLFLAGS_NORMAL);
+ hr = marshal_object(apt, &stdobjref, &IID_IRemUnknown, (IUnknown *)pRemUnknown, MSHLFLAGS_NORMAL|MSHLFLAGSP_REMUNKNOWN);
/* release our reference to the object as the stub manager will manage the life cycle for us */
IRemUnknown_Release(pRemUnknown);
if (hr == S_OK)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 41a2aec..7e3e82e 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -2199,12 +2199,7 @@ static void test_client_security(void)
CoTaskMemFree(pServerPrincName);
IClassFactory_Release(pProxy);
-#if 0
- /* FIXME: fix stub manager to not depend on the IID of the interface to
- * determine whether it is really the rem unknown for the object before
- * re-enabling this line */
IUnknown_Release(pProxy2);
-#endif
IUnknown_Release(pUnknown1);
IUnknown_Release(pUnknown2);
IMarshal_Release(pMarshal);