ole32: Objects registered as local servers don't need to support IClassFactory.

This commit is contained in:
Rob Shearman 2009-11-20 14:48:57 +00:00 committed by Alexandre Julliard
parent 377159c4a7
commit d963e97f32
2 changed files with 9 additions and 1 deletions

View File

@ -2130,7 +2130,7 @@ HRESULT WINAPI CoRegisterClassObject(
FIXME("Failed to create stream on hglobal, %x\n", hr);
return hr;
}
hr = CoMarshalInterface(newClass->pMarshaledData, &IID_IClassFactory,
hr = CoMarshalInterface(newClass->pMarshaledData, &IID_IUnknown,
newClass->classObject, MSHCTX_LOCAL, NULL,
MSHLFLAGS_TABLESTRONG);
if (hr) {

View File

@ -837,6 +837,14 @@ static void test_CoRegisterClassObject(void)
hr = CoRevokeClassObject(cookie);
ok_ole_success(hr, "CoRevokeClassObject");
/* test whether an object that doesn't support IClassFactory can be
* registered for CLSCTX_LOCAL_SERVER */
hr = CoRegisterClassObject(&CLSID_WineOOPTest, &Test_Unknown,
CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE, &cookie);
ok_ole_success(hr, "CoRegisterClassObject");
hr = CoRevokeClassObject(cookie);
ok_ole_success(hr, "CoRevokeClassObject");
/* test whether registered class becomes invalid when apartment is destroyed */
hr = CoRegisterClassObject(&CLSID_WineOOPTest, (IUnknown *)&Test_ClassFactory,
CLSCTX_INPROC_SERVER, REGCLS_SINGLEUSE, &cookie);