UnregisterClassA(aptWinClass, OLE32_hInstance);
}
+void COM_TlsDestroy()
+{
+ struct oletls *info = NtCurrentTeb()->ReservedForOle;
+ if (info)
+ {
+ if (info->apt) COM_ApartmentRelease(info->apt);
+ if (info->errorinfo) IErrorInfo_Release(info->errorinfo);
+ if (info->state) IUnknown_Release(info->state);
+ HeapFree(GetProcessHeap(), 0, info);
+ NtCurrentTeb()->ReservedForOle = NULL;
+ }
+}
+
/******************************************************************************
* Manage apartments.
*/
/* Changing the threading model after it's been set is illegal. If this warning is triggered by Wine
code then we are probably using the wrong threading model to implement that API. */
ERR("Attempt to change threading model of this apartment from 0x%lx to 0x%lx\n", apt->model, dwCoInit);
- COM_ApartmentRelease(apt);
return RPC_E_CHANGED_MODE;
}
else
hr = IRemUnknown_RemRelease(remunk, 1, &rif);
if (hr == S_OK)
This->refs = 0;
+ else if (hr == RPC_E_DISCONNECTED)
+ WARN("couldn't release references because object was "
+ "disconnected: oxid = %s, oid = %s\n",
+ wine_dbgstr_longlong(This->parent->oxid),
+ wine_dbgstr_longlong(This->parent->oid));
else
ERR("IRemUnknown_RemRelease failed with error 0x%08lx\n", hr);
}
ifproxy->proxy = NULL;
/* the IUnknown interface is special because it does not have a
- * proxy associated with the ifproxy as we handle IUnknown ourselves */
- if (IsEqualIID(riid, &IID_IUnknown))
+ * proxy associated with the ifproxy as we handle IUnknown ourselves.
+ * IID_NULL is a placeholder for IID_IUnknown used by the DCOM part of
+ * the rpc runtime. */
+ if (IsEqualIID(riid, &IID_NULL) ||
+ IsEqualIID(riid, &IID_IUnknown))
{
ifproxy->iface = (void *)&This->lpVtbl;
hr = S_OK;
HRESULT hr;
MSG msg;
- CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (data->filter)
{
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);
ok_more_than_one_lock();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);
ok_more_than_one_lock();
end_host_object(tid, thread);
- CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
}
/* tests that proxies are released when the containing mta apartment is destroyed */
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);
ok_more_than_one_lock();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy1);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
ok_more_than_one_lock();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy1);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
ok_more_than_one_lock();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);
ok_more_than_one_lock();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IUnknown, (void **)&pProxy);
- ok_ole_success(hr, CoReleaseMarshalData);
+ ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);
ok_more_than_one_lock();