diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 32283e6d958..8e78519dc80 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -922,12 +922,12 @@ static const ISynchronizeHandleVtbl SynchronizeHandleVtbl = { SynchronizeHandle_GetHandle }; -static HRESULT ManualResetEvent_Construct(IUnknown *punkouter, REFIID iid, void **ppv) +HRESULT WINAPI ManualResetEvent_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **ppv) { MREImpl *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MREImpl)); HRESULT hr; - if(punkouter) + if (outer) FIXME("Aggregation not implemented.\n"); This->ref = 1; @@ -3004,7 +3004,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstanceEx( } if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) { - hres = ManualResetEvent_Construct(pUnkOuter, pResults[0].pIID, (void**)&unk); + hres = ManualResetEvent_CreateInstance(&ManualResetEventCF, pUnkOuter, pResults[0].pIID, (void**)&unk); if (FAILED(hres)) return hres; return return_multi_qi(unk, cmq, pResults, TRUE); diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 3156f86f898..974c230ddce 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -322,6 +322,9 @@ extern IClassFactory GlobalOptionsCF DECLSPEC_HIDDEN; extern HRESULT WINAPI GlobalInterfaceTable_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **obj) DECLSPEC_HIDDEN; extern IClassFactory GlobalInterfaceTableCF DECLSPEC_HIDDEN; +extern HRESULT WINAPI ManualResetEvent_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, + void **obj) DECLSPEC_HIDDEN; +extern IClassFactory ManualResetEventCF DECLSPEC_HIDDEN; /* Exported non-interface Data Advise Holder functions */ HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate) DECLSPEC_HIDDEN; diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index 93ff5b0da84..29cd391e127 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -170,6 +170,17 @@ static const IClassFactoryVtbl GlobalInterfaceTableCFVtbl = IClassFactory GlobalInterfaceTableCF = { &GlobalInterfaceTableCFVtbl }; +static const IClassFactoryVtbl ManualResetEventCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ManualResetEvent_CreateInstance, + ClassFactory_LockServer +}; + +IClassFactory ManualResetEventCF = { &ManualResetEventCFVtbl }; + /*********************************************************************** * DllGetClassObject [OLE32.@] */ @@ -186,6 +197,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) return MARSHAL_GetStandardMarshalCF(ppv); if (IsEqualCLSID(rclsid, &CLSID_StdGlobalInterfaceTable)) return IClassFactory_QueryInterface(&GlobalInterfaceTableCF, iid, ppv); + if (IsEqualCLSID(rclsid, &CLSID_ManualResetEvent)) + return IClassFactory_QueryInterface(&ManualResetEventCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_FileMoniker)) return IClassFactory_QueryInterface(&FileMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker)) diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index e2608ecb768..ef608e66d01 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -4006,11 +4006,16 @@ static void test_manualresetevent(void) { ISynchronizeHandle *sync_handle; ISynchronize *psync1, *psync2; + IClassFactory *factory; IUnknown *punk; HANDLE handle; LONG ref; HRESULT hr; + hr = pDllGetClassObject(&CLSID_ManualResetEvent, &IID_IClassFactory, (void **)&factory); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IClassFactory_Release(factory); + hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&punk); ok(hr == S_OK, "Got 0x%08x\n", hr); ok(!!punk, "Got NULL.\n");