Commit 43d5d867 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Fix IClassFactory initialization and QueryInterface behavior for GIT.

parent 5f2e48f7
......@@ -311,8 +311,8 @@ static HRESULT WINAPI
GITCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualIID(riid,&IID_IUnknown) ||
IsEqualIID(riid,&IID_IGlobalInterfaceTable))
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = iface;
return S_OK;
......@@ -357,11 +357,11 @@ static const IClassFactoryVtbl GITClassFactoryVtbl = {
GITCF_LockServer
};
static const IClassFactoryVtbl *PGITClassFactoryVtbl = &GITClassFactoryVtbl;
static IClassFactory git_classfactory = { &GITClassFactoryVtbl };
HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv)
{
*ppv = &PGITClassFactoryVtbl;
*ppv = &git_classfactory;
TRACE("Returning GIT classfactory\n");
return S_OK;
}
......
......@@ -40,6 +40,7 @@ DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x0
/* functions that are not present on all versions of Windows */
static HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit);
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID);
/* helper macros to make tests a bit leaner */
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
......@@ -2804,10 +2805,19 @@ static void test_globalinterfacetable(void)
struct git_params params;
DWORD ret;
IUnknown *object;
IClassFactory *cf;
trace("test_globalinterfacetable\n");
cLocks = 0;
hr = pDllGetClassObject(&CLSID_StdGlobalInterfaceTable, &IID_IClassFactory, (void**)&cf);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IClassFactory_QueryInterface(cf, &IID_IGlobalInterfaceTable, (void**)&object);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
IClassFactory_Release(cf);
hr = CoCreateInstance(&CLSID_StdGlobalInterfaceTable, NULL, CLSCTX_INPROC_SERVER, &IID_IGlobalInterfaceTable, (void **)&git);
ok_ole_success(hr, CoCreateInstance);
......@@ -3149,6 +3159,7 @@ START_TEST(marshal)
}
pCoInitializeEx = (void*)GetProcAddress(hOle32, "CoInitializeEx");
pDllGetClassObject = (void*)GetProcAddress(hOle32, "DllGetClassObject");
argc = winetest_get_mainargs( &argv );
if (argc > 2 && (!strcmp(argv[2], "-Embedding")))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment