Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/Makefile.in | 1 + dlls/{ole32 => combase}/apartment.c | 94 +++++++++++++++++------------ dlls/combase/combase.c | 19 ++++++ dlls/combase/combase.spec | 16 +++++ dlls/combase/combase_private.h | 42 +++++++++++++ dlls/ole32/Makefile.in | 1 - dlls/ole32/compobj.c | 10 ++- dlls/ole32/compobj_private.h | 31 +++++----- dlls/ole32/marshal.c | 2 +- dlls/ole32/ole32.spec | 5 ++ dlls/ole32/rpc.c | 4 +- dlls/ole32/stubmanager.c | 5 ++ 12 files changed, 165 insertions(+), 65 deletions(-) rename dlls/{ole32 => combase}/apartment.c (92%)
diff --git a/dlls/combase/Makefile.in b/dlls/combase/Makefile.in index 16a2bfa3167..45e1ff189cb 100644 --- a/dlls/combase/Makefile.in +++ b/dlls/combase/Makefile.in @@ -6,6 +6,7 @@ DELAYIMPORTS = oleaut32 EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ + apartment.c \ combase.c \ errorinfo.c \ malloc.c \ diff --git a/dlls/ole32/apartment.c b/dlls/combase/apartment.c similarity index 92% rename from dlls/ole32/apartment.c rename to dlls/combase/apartment.c index 456e6c80a36..dbf4553fa41 100644 --- a/dlls/ole32/apartment.c +++ b/dlls/combase/apartment.c @@ -33,7 +33,7 @@ #include "winbase.h" #include "servprov.h"
-#include "compobj_private.h" +#include "combase_private.h"
#include "wine/debug.h" #include "wine/list.h" @@ -306,10 +306,13 @@ static ULONG WINAPI local_server_Release(IServiceProvider *iface) return refcount; }
+extern HRESULT WINAPI InternalGetRegisteredClassObject(struct apartment *apt, REFGUID guid, + DWORD clscontext, IUnknown **obj); + static HRESULT WINAPI local_server_QueryService(IServiceProvider *iface, REFGUID guid, REFIID riid, void **obj) { struct local_server *local_server = impl_from_IServiceProvider(iface); - struct apartment *apt = COM_CurrentApt(); + struct apartment *apt = com_get_current_apt(); HRESULT hr = E_FAIL; IUnknown *unk;
@@ -318,7 +321,7 @@ static HRESULT WINAPI local_server_QueryService(IServiceProvider *iface, REFGUID if (!local_server->apt) return E_UNEXPECTED;
- if (SUCCEEDED(COM_GetRegisteredClassObject(apt, guid, CLSCTX_LOCAL_SERVER, &unk))) + if (SUCCEEDED(InternalGetRegisteredClassObject(apt, guid, CLSCTX_LOCAL_SERVER, &unk))) { hr = IUnknown_QueryInterface(unk, riid, obj); IUnknown_Release(unk); @@ -335,7 +338,7 @@ static const IServiceProviderVtbl local_server_vtbl = local_server_QueryService };
-HRESULT apartment_get_local_server_stream(struct apartment *apt, IStream **ret) +HRESULT WINAPI apartment_get_local_server_stream(struct apartment *apt, IStream **ret) { HRESULT hr = S_OK;
@@ -400,7 +403,7 @@ static struct apartment *apartment_construct(DWORD model) apt->remunk_exported = FALSE; apt->oidc = 1; InitializeCriticalSection(&apt->cs); - DEBUG_SET_CRITSEC_NAME(&apt->cs, "apartment"); + apt->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": apartment");
apt->multi_threaded = !(model & COINIT_APARTMENTTHREADED);
@@ -423,7 +426,7 @@ static struct apartment *apartment_construct(DWORD model) }
/* Frees unused libraries loaded into apartment */ -void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) +void WINAPI apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) { struct apartment_loaded_dll *entry, *next;
@@ -464,7 +467,11 @@ void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) LeaveCriticalSection(&apt->cs); }
-void apartment_release(struct apartment *apt) +extern void WINAPI InternalRevokeAllClasses(struct apartment *apt); +extern HRESULT WINAPI Internal_apartment_disconnectproxies(struct apartment *apt); +extern ULONG WINAPI Internal_stub_manager_int_release(struct stub_manager *stubmgr); + +void WINAPI apartment_release(struct apartment *apt) { DWORD refcount;
@@ -513,12 +520,12 @@ void apartment_release(struct apartment *apt) }
/* Release the references to the registered class objects */ - COM_RevokeAllClasses(apt); + InternalRevokeAllClasses(apt);
/* no locking is needed for this apartment, because no other thread * can access it at this point */
- apartment_disconnectproxies(apt); + Internal_apartment_disconnectproxies(apt);
if (apt->win) DestroyWindow(apt->win); if (apt->host_apt_tid) PostThreadMessageW(apt->host_apt_tid, WM_QUIT, 0, 0); @@ -531,7 +538,7 @@ void apartment_release(struct apartment *apt) * stub manager list in the apartment and all non-apartment users * must have a ref on the apartment and so it cannot be destroyed). */ - stub_manager_int_release(stubmgr); + Internal_stub_manager_int_release(stubmgr); }
/* if this assert fires, then another thread took a reference to a @@ -555,7 +562,7 @@ void apartment_release(struct apartment *apt) heap_free(apartment_loaded_dll); }
- DEBUG_CLEAR_CRITSEC_NAME(&apt->cs); + apt->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&apt->cs);
heap_free(apt); @@ -572,7 +579,8 @@ static DWORD apartment_addref(struct apartment *apt) /* Gets existing apartment or creates a new one and enters it */ static struct apartment *apartment_get_or_create(DWORD model) { - struct apartment *apt = COM_CurrentApt(); + struct apartment *apt = com_get_current_apt(); + struct tlsdata *data;
if (!apt) { @@ -612,13 +620,14 @@ static struct apartment *apartment_get_or_create(DWORD model)
LeaveCriticalSection(&apt_cs); } - COM_CurrentInfo()->apt = apt; + com_get_tlsdata(&data); + data->apt = apt; }
return apt; }
-struct apartment *apartment_get_mta(void) +struct apartment * WINAPI apartment_get_mta(void) { struct apartment *apt;
@@ -634,9 +643,9 @@ struct apartment *apartment_get_mta(void)
/* Return the current apartment if it exists, or, failing that, the MTA. Caller * must free the returned apartment in either case. */ -struct apartment *apartment_get_current_or_mta(void) +struct apartment * WINAPI apartment_get_current_or_mta(void) { - struct apartment *apt = COM_CurrentApt(); + struct apartment *apt = com_get_current_apt(); if (apt) { apartment_addref(apt); @@ -646,7 +655,7 @@ struct apartment *apartment_get_current_or_mta(void) }
/* The given OXID must be local to this process */ -struct apartment *apartment_findfromoxid(OXID oxid) +struct apartment * WINAPI apartment_findfromoxid(OXID oxid) { struct apartment *result = NULL; struct list *cursor; @@ -670,7 +679,7 @@ struct apartment *apartment_findfromoxid(OXID oxid) /* gets the apartment which has a given creator thread ID. The caller must * release the reference from the apartment as soon as the apartment pointer * is no longer required. */ -struct apartment *apartment_findfromtid(DWORD tid) +struct apartment * WINAPI apartment_findfromtid(DWORD tid) { struct apartment *result = NULL; struct list *cursor; @@ -778,10 +787,14 @@ static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath,
if (!wcsicmp(dllpath, L"ole32.dll")) { + HRESULT (WINAPI *p_ole32_DllGetClassObject)(REFCLSID clsid, REFIID riid, void **obj); + + p_ole32_DllGetClassObject = (void *)GetProcAddress(GetModuleHandleW(L"ole32.dll"), "DllGetClassObject"); + /* we don't need to control the lifetime of this dll, so use the local * implementation of DllGetClassObject directly */ TRACE("calling ole32!DllGetClassObject\n"); - hr = DllGetClassObject(rclsid, riid, ppv); + hr = p_ole32_DllGetClassObject(rclsid, riid, ppv);
if (hr != S_OK) ERR("DllGetClassObject returned error 0x%08x for dll %s\n", hr, debugstr_w(dllpath)); @@ -863,7 +876,7 @@ static DWORD CALLBACK apartment_hostobject_thread(void *p) hr = CoInitializeEx(NULL, params->threading_model); if (FAILED(hr)) return hr;
- apt = COM_CurrentApt(); + apt = com_get_current_apt(); if (params->threading_model == COINIT_APARTMENTTHREADED) { apartment_createwindowifneeded(apt); @@ -1035,7 +1048,7 @@ static enum comclass_threadingmodel get_threading_model(const struct class_reg_d return data->u.actctx.threading_model; }
-HRESULT apartment_get_inproc_class_object(struct apartment *apt, const struct class_reg_data *regdata, +HRESULT WINAPI apartment_get_inproc_class_object(struct apartment *apt, const struct class_reg_data *regdata, REFCLSID rclsid, REFIID riid, BOOL hostifnecessary, void **ppv) { WCHAR dllpath[MAX_PATH+1]; @@ -1112,15 +1125,18 @@ static HRESULT apartment_hostobject(struct apartment *apt, const struct host_obj return hr; }
+struct dispatch_params; +extern void WINAPI Internal_RPC_ExecuteCall(struct dispatch_params *params); + static LRESULT CALLBACK apartment_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case DM_EXECUTERPC: - RPC_ExecuteCall((struct dispatch_params *)lParam); + Internal_RPC_ExecuteCall((struct dispatch_params *)lParam); return 0; case DM_HOSTOBJECT: - return apartment_hostobject(COM_CurrentApt(), (const struct host_object_params *)lParam); + return apartment_hostobject(com_get_current_apt(), (const struct host_object_params *)lParam); default: return DefWindowProcW(hWnd, msg, wParam, lParam); } @@ -1131,38 +1147,38 @@ static BOOL apartment_is_model(const struct apartment *apt, DWORD model) return (apt->multi_threaded == !(model & COINIT_APARTMENTTHREADED)); }
-HRESULT enter_apartment(struct oletls *info, DWORD model) +HRESULT WINAPI enter_apartment(struct tlsdata *data, DWORD model) { HRESULT hr = S_OK;
- if (!info->apt) + if (!data->apt) { if (!apartment_get_or_create(model)) return E_OUTOFMEMORY; } - else if (!apartment_is_model(info->apt, model)) + else if (!apartment_is_model(data->apt, model)) { - WARN( "Attempt to change threading model of this apartment from %s to %s\n", - info->apt->multi_threaded ? "multi-threaded" : "apartment threaded", + WARN("Attempt to change threading model of this apartment from %s to %s\n", + data->apt->multi_threaded ? "multi-threaded" : "apartment threaded", model & COINIT_APARTMENTTHREADED ? "apartment threaded" : "multi-threaded" ); return RPC_E_CHANGED_MODE; } else hr = S_FALSE;
- info->inits++; + data->inits++;
return hr; }
-void leave_apartment(struct oletls *info) +void WINAPI leave_apartment(struct tlsdata *data) { - if (!--info->inits) + if (!--data->inits) { - if (info->ole_inits) + if (data->ole_inits) WARN( "Uninitializing apartment while Ole is still initialized\n" ); - apartment_release(info->apt); - info->apt = NULL; + apartment_release(data->apt); + data->apt = NULL; } }
@@ -1171,7 +1187,7 @@ struct mta_cookie struct list entry; };
-HRESULT apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) +HRESULT WINAPI apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) { struct mta_cookie *mta_cookie;
@@ -1195,7 +1211,7 @@ HRESULT apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) return S_OK; }
-void apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie) +void WINAPI apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie) { struct mta_cookie *mta_cookie = (struct mta_cookie *)cookie;
@@ -1246,7 +1262,7 @@ static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context
/* create a window for the apartment or return the current one if one has * already been created */ -HRESULT apartment_createwindowifneeded(struct apartment *apt) +HRESULT WINAPI apartment_createwindowifneeded(struct apartment *apt) { static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT;
@@ -1274,13 +1290,13 @@ HRESULT apartment_createwindowifneeded(struct apartment *apt) }
/* retrieves the window for the main- or apartment-threaded apartment */ -HWND apartment_getwindow(const struct apartment *apt) +HWND WINAPI apartment_getwindow(const struct apartment *apt) { assert(!apt->multi_threaded); return apt->win; }
-void apartment_global_cleanup(void) +void WINAPI apartment_global_cleanup(void) { if (apt_win_class) UnregisterClassW((const WCHAR *)MAKEINTATOM(apt_win_class), hProxyDll); diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 80d6ece266e..286b7be8b86 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -36,6 +36,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
+HINSTANCE hProxyDll; + #define CHARS_IN_GUID 39
struct comclassredirect_data @@ -2249,3 +2251,20 @@ DWORD WINAPI CoGetCurrentProcess(void)
return tlsdata->thread_seqid; } + +/*********************************************************************** + * DllMain (combase.@) + */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) +{ + TRACE("%p 0x%x %p\n", hinstDLL, reason, reserved); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + hProxyDll = hinstDLL; + break; + } + + return TRUE; +} diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 9038d5fa8bf..980ffa820cd 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -351,3 +351,19 @@ @ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) @ stdcall WindowsTrimStringEnd(ptr ptr ptr) @ stdcall WindowsTrimStringStart(ptr ptr ptr) + +@ stdcall apartment_get_current_or_mta() +@ stdcall apartment_release(ptr) +@ stdcall enter_apartment(ptr long) +@ stdcall leave_apartment(ptr) +@ stdcall apartment_get_inproc_class_object(ptr ptr ptr ptr long ptr) +@ stdcall apartment_freeunusedlibraries(ptr long) +@ stdcall apartment_get_mta() +@ stdcall apartment_decrement_mta_usage(ptr) +@ stdcall apartment_increment_mta_usage(ptr) +@ stdcall apartment_findfromoxid(int64) +@ stdcall apartment_getwindow(ptr) +@ stdcall apartment_global_cleanup() +@ stdcall apartment_createwindowifneeded(ptr) +@ stdcall apartment_get_local_server_stream(ptr ptr) +@ stdcall apartment_findfromtid(long) diff --git a/dlls/combase/combase_private.h b/dlls/combase/combase_private.h index 7d7583282e1..16d926d13b4 100644 --- a/dlls/combase/combase_private.h +++ b/dlls/combase/combase_private.h @@ -17,8 +17,11 @@ #include "winternl.h" #include "wine/orpc.h"
+#include "wine/heap.h" #include "wine/list.h"
+extern HINSTANCE hProxyDll; + struct apartment { struct list entry; @@ -51,6 +54,10 @@ struct apartment struct list usage_cookies; /* Used for refcount control with CoIncrementMTAUsage()/CoDecrementMTAUsage(). */ };
+/* DCOM messages used by the apartment window (not compatible with native) */ +#define DM_EXECUTERPC (WM_USER + 0) /* WPARAM = 0, LPARAM = (struct dispatch_params *) */ +#define DM_HOSTOBJECT (WM_USER + 1) /* WPARAM = 0, LPARAM = (struct host_object_params *) */ + /* this is what is stored in TEB->ReservedForOle */ struct tlsdata { @@ -89,5 +96,40 @@ static inline struct apartment* com_get_current_apt(void) return tlsdata->apt; }
+HWND WINAPI apartment_getwindow(const struct apartment *apt) DECLSPEC_HIDDEN; +HRESULT WINAPI apartment_createwindowifneeded(struct apartment *apt) DECLSPEC_HIDDEN; + /* RpcSs interface */ HRESULT rpcss_get_next_seqid(DWORD *id) DECLSPEC_HIDDEN; + +/* stub managers hold refs on the object and each interface stub */ +struct stub_manager +{ + struct list entry; /* entry in apartment stubmgr list (CS apt->cs) */ + struct list ifstubs; /* list of active ifstubs for the object (CS lock) */ + CRITICAL_SECTION lock; + struct apartment *apt; /* owning apt (RO) */ + + ULONG extrefs; /* number of 'external' references (CS lock) */ + ULONG refs; /* internal reference count (CS apt->cs) */ + ULONG weakrefs; /* number of weak references (CS lock) */ + OID oid; /* apartment-scoped unique identifier (RO) */ + IUnknown *object; /* the object we are managing the stub for (RO) */ + ULONG next_ipid; /* currently unused (LOCK) */ + OXID_INFO oxid_info; /* string binding, ipid of rem unknown and other information (RO) */ + + IExternalConnection *extern_conn; + + /* We need to keep a count of the outstanding marshals, so we can enforce the + * marshalling rules (ie, you can only unmarshal normal marshals once). Note + * that these counts do NOT include unmarshalled interfaces, once a stream is + * unmarshalled and a proxy set up, this count is decremented. + */ + + ULONG norm_refs; /* refcount of normal marshals (CS lock) */ + BOOL disconnected; /* CoDisconnectObject has been called (CS lock) */ +}; + +/* Stub Manager */ + +ULONG stub_manager_int_release(struct stub_manager *This) DECLSPEC_HIDDEN; diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index 5a2b21dee4f..1c1e28fa4c5 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -8,7 +8,6 @@ EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ antimoniker.c \ - apartment.c \ bindctx.c \ classmoniker.c \ clipboard.c \ diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index d59da4207a7..8451953baaf 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -393,7 +393,7 @@ static void COM_RevokeRegisteredClassObject(RegisteredClass *curClass) HeapFree(GetProcessHeap(), 0, curClass); }
-void COM_RevokeAllClasses(const struct apartment *apt) +void WINAPI InternalRevokeAllClasses(const struct apartment *apt) { RegisteredClass *curClass, *cursor;
@@ -997,8 +997,6 @@ HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey }
/*** - * COM_GetRegisteredClassObject - * * This internal method is used to scan the registered class list to * find a class object. * @@ -1009,7 +1007,7 @@ HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey * to normal COM usage, this method will increase the * reference count on this object. */ -HRESULT COM_GetRegisteredClassObject(const struct apartment *apt, REFCLSID rclsid, +HRESULT WINAPI InternalGetRegisteredClassObject(const struct apartment *apt, REFCLSID rclsid, DWORD dwClsContext, LPUNKNOWN* ppUnk) { HRESULT hr = S_FALSE; @@ -1110,7 +1108,7 @@ HRESULT WINAPI CoRegisterClassObject( * First, check if the class is already registered. * If it is, this should cause an error. */ - hr = COM_GetRegisteredClassObject(apt, rclsid, dwClsContext, &foundObject); + hr = InternalGetRegisteredClassObject(apt, rclsid, dwClsContext, &foundObject); if (hr == S_OK) { if (flags & REGCLS_MULTIPLEUSE) { if (dwClsContext & CLSCTX_LOCAL_SERVER) @@ -1267,7 +1265,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject( * First, try and see if we can't match the class ID with one of the * registered classes. */ - if (S_OK == COM_GetRegisteredClassObject(apt, rclsid, dwClsContext, + if (S_OK == InternalGetRegisteredClassObject(apt, rclsid, dwClsContext, ®ClassObject)) { /* Get the required interface from the retrieved pointer. */ diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 156b6bb2f44..34fe1e7a381 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -245,31 +245,30 @@ void OLEDD_UnInitialize(void) DECLSPEC_HIDDEN;
/* Apartment Functions */
-struct apartment *apartment_findfromoxid(OXID oxid) DECLSPEC_HIDDEN; -struct apartment *apartment_findfromtid(DWORD tid) DECLSPEC_HIDDEN; -void apartment_release(struct apartment *apt) DECLSPEC_HIDDEN; -HRESULT apartment_disconnectproxies(struct apartment *apt) DECLSPEC_HIDDEN; +extern struct apartment * WINAPI apartment_findfromoxid(OXID oxid) DECLSPEC_HIDDEN; +extern struct apartment * WINAPI apartment_findfromtid(DWORD tid) DECLSPEC_HIDDEN; +extern void WINAPI apartment_release(struct apartment *apt) DECLSPEC_HIDDEN; static inline HRESULT apartment_getoxid(const struct apartment *apt, OXID *oxid) { *oxid = apt->oxid; return S_OK; } -HRESULT apartment_createwindowifneeded(struct apartment *apt) DECLSPEC_HIDDEN; -HWND apartment_getwindow(const struct apartment *apt) DECLSPEC_HIDDEN; -HRESULT enter_apartment(struct oletls *info, DWORD model) DECLSPEC_HIDDEN; -void leave_apartment(struct oletls *info) DECLSPEC_HIDDEN; -struct apartment *apartment_get_current_or_mta(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI apartment_createwindowifneeded(struct apartment *apt) DECLSPEC_HIDDEN; +extern HWND WINAPI apartment_getwindow(const struct apartment *apt) DECLSPEC_HIDDEN; +extern HRESULT WINAPI enter_apartment(struct oletls *info, DWORD model) DECLSPEC_HIDDEN; +void WINAPI leave_apartment(struct oletls *info) DECLSPEC_HIDDEN; +extern struct apartment * WINAPI apartment_get_current_or_mta(void) DECLSPEC_HIDDEN;
struct class_reg_data; -HRESULT apartment_get_inproc_class_object(struct apartment *apt, const struct class_reg_data *regdata, +extern HRESULT WINAPI apartment_get_inproc_class_object(struct apartment *apt, const struct class_reg_data *regdata, REFCLSID rclsid, REFIID riid, BOOL hostifnecessary, void **ppv) DECLSPEC_HIDDEN;
-void apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie) DECLSPEC_HIDDEN; -HRESULT apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) DECLSPEC_HIDDEN; -struct apartment *apartment_get_mta(void) DECLSPEC_HIDDEN; -HRESULT apartment_get_local_server_stream(struct apartment *apt, IStream **ret) DECLSPEC_HIDDEN; -void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) DECLSPEC_HIDDEN; -void apartment_global_cleanup(void) DECLSPEC_HIDDEN; +extern void WINAPI apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie) DECLSPEC_HIDDEN; +extern HRESULT WINAPI apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) DECLSPEC_HIDDEN; +extern struct apartment * WINAPI apartment_get_mta(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI apartment_get_local_server_stream(struct apartment *apt, IStream **ret) DECLSPEC_HIDDEN; +extern void WINAPI apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) DECLSPEC_HIDDEN; +extern void WINAPI apartment_global_cleanup(void) DECLSPEC_HIDDEN;
HRESULT COM_GetRegisteredClassObject(const struct apartment *apt, REFCLSID rclsid, DWORD dwClsContext, IUnknown **ppUnk) DECLSPEC_HIDDEN; diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 8cc35354d53..d08144f619a 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1223,7 +1223,7 @@ static BOOL find_proxy_manager(struct apartment * apt, OXID oxid, OID oid, struc return found; }
-HRESULT apartment_disconnectproxies(struct apartment *apt) +HRESULT WINAPI Internal_apartment_disconnectproxies(struct apartment *apt) { struct list * cursor;
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 2564851c4b5..4a2e6b531ab 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -298,3 +298,8 @@ @ stub WriteOleStg @ stub WriteStringStream @ stdcall InternalIsInitialized() +@ stdcall InternalGetRegisteredClassObject(ptr ptr long ptr) +@ stdcall InternalRevokeAllClasses(ptr) +@ stdcall Internal_apartment_disconnectproxies(ptr) +@ stdcall Internal_RPC_ExecuteCall(ptr) +@ stdcall Internal_stub_manager_int_release(ptr) diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index d0b0f49319d..1c88ae21543 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -1324,7 +1324,7 @@ static HRESULT unmarshal_ORPCTHAT(RPC_MESSAGE *msg, ORPCTHAT *orpcthat, return S_OK; }
-void RPC_ExecuteCall(struct dispatch_params *params) +void WINAPI Internal_RPC_ExecuteCall(struct dispatch_params *params) { struct message_state *message_state = NULL; RPC_MESSAGE *msg = (RPC_MESSAGE *)params->msg; @@ -1504,7 +1504,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg) enter_apartment(info, COINIT_MULTITHREADED); joined = TRUE; } - RPC_ExecuteCall(params); + Internal_RPC_ExecuteCall(params); if (joined) { leave_apartment(info); diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c index 338b89750ef..d38e22adb47 100644 --- a/dlls/ole32/stubmanager.c +++ b/dlls/ole32/stubmanager.c @@ -307,6 +307,11 @@ static ULONG stub_manager_int_addref(struct stub_manager *This) return refs; }
+ULONG WINAPI Internal_stub_manager_int_release(struct stub_manager *m) +{ + return stub_manager_int_release(m); +} + /* decrements the internal refcount */ ULONG stub_manager_int_release(struct stub_manager *This) {