Log: Ove Kaaven <ovek@transgaming.com> Fixed NdrDllRegisterProxy so it registers the key names that ole32 expects. Better debug traces (include name of interface). Index: dlls/rpcrt4/cproxy.c =================================================================== RCS file: /cvsroot/rewind/rewind/dlls/rpcrt4/cproxy.c,v retrieving revision 1.2 diff -u -r1.2 cproxy.c --- dlls/rpcrt4/cproxy.c 6 Dec 2002 09:59:24 -0000 1.2 +++ dlls/rpcrt4/cproxy.c 19 May 2003 22:29:00 -0000 @@ -32,6 +32,7 @@ const MIDL_STUBLESS_PROXY_INFO *stubless; const IID* piid; LPUNKNOWN pUnkOuter; + PCInterfaceName name; LPPSFACTORYBUFFER pPSFactory; LPRPCCHANNELBUFFER pChannel; struct StublessThunk *thunks; @@ -92,6 +93,7 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid, LPUNKNOWN pUnkOuter, + PCInterfaceName name, CInterfaceProxyVtbl *vtbl, CInterfaceStubVtbl *svtbl, LPPSFACTORYBUFFER pPSFactory, @@ -101,7 +103,7 @@ StdProxyImpl *This; const MIDL_STUBLESS_PROXY_INFO *stubless = NULL; - TRACE("(%p,%p,%p,%p,%p)\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj); + TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name); /* I can't find any other way to detect stubless proxies than this hack */ if (!IsEqualGUID(vtbl->header.piid, riid)) { @@ -151,6 +153,7 @@ This->stubless = stubless; This->piid = vtbl->header.piid; This->pUnkOuter = pUnkOuter; + This->name = name; This->pPSFactory = pPSFactory; This->pChannel = NULL; *ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl; @@ -247,7 +250,7 @@ LPRPCCHANNELBUFFER *ppChannel) { ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->GetChannel(%p)\n",This,ppChannel); + TRACE("(%p)->GetChannel(%p) %s\n",This,ppChannel,This->name); *ppChannel = This->pChannel; return S_OK; @@ -257,7 +260,7 @@ const IID **ppiid) { ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->GetIID(%p)\n",This,ppiid); + TRACE("(%p)->GetIID(%p) %s\n",This,ppiid,This->name); *ppiid = This->piid; return S_OK; @@ -268,14 +271,14 @@ LPVOID *ppvObj) { ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),ppvObj); + TRACE("(%p)->QueryInterface(%s,%p) %s\n",This,debugstr_guid(riid),ppvObj,This->name); return IUnknown_QueryInterface(This->pUnkOuter,riid,ppvObj); } ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface) { ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->AddRef()\n",This); + TRACE("(%p)->AddRef() %s\n",This,This->name); #if 0 /* interface refcounting */ return ++(This->RefCount); #else /* object refcounting */ @@ -286,7 +289,7 @@ ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface) { ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->Release()\n",This); + TRACE("(%p)->Release() %s\n",This,This->name); #if 0 /* interface refcounting */ if (!--(This->RefCount)) { StdProxy_Destruct((LPRPCPROXYBUFFER)&This->lpVtbl); Index: dlls/rpcrt4/cpsf.c =================================================================== RCS file: /cvsroot/rewind/rewind/dlls/rpcrt4/cpsf.c,v retrieving revision 1.3 diff -u -r1.3 cpsf.c --- dlls/rpcrt4/cpsf.c 17 Feb 2003 14:32:37 -0000 1.3 +++ dlls/rpcrt4/cpsf.c 19 May 2003 22:29:00 -0000 @@ -78,8 +78,9 @@ debugstr_guid(riid),ppProxy,ppv); if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) return E_NOINTERFACE; - return StdProxy_Construct(riid, pUnkOuter, ProxyInfo->pProxyVtblList[Index], - ProxyInfo->pStubVtblList[Index], iface, ppProxy, ppv); + return StdProxy_Construct(riid, pUnkOuter, ProxyInfo->pNamesArray[Index], + ProxyInfo->pProxyVtblList[Index], + ProxyInfo->pStubVtblList[Index], iface, ppProxy, ppv); } static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface, @@ -94,7 +95,8 @@ pUnkServer,ppStub); if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) return E_NOINTERFACE; - return CStdStubBuffer_Construct(riid, pUnkServer, ProxyInfo->pStubVtblList[Index], iface, ppStub); + return CStdStubBuffer_Construct(riid, pUnkServer, ProxyInfo->pNamesArray[Index], + ProxyInfo->pStubVtblList[Index], iface, ppStub); } static ICOM_VTABLE(IPSFactoryBuffer) CStdPSFactory_Vtbl = @@ -159,7 +161,7 @@ TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); UuidToStringA((UUID*)proxy->header.piid, &iid); - snprintf(keyname, sizeof(keyname), "Interface\\%s", iid); + snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); RpcStringFreeA(&iid); if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { @@ -167,7 +169,8 @@ RegSetValueExA(key, NULL, 0, REG_SZ, name, strlen(name)); if (RegCreateKeyExA(key, "ProxyStubClsid32", 0, NULL, 0, KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { - RegSetValueExA(subkey, NULL, 0, REG_SZ, clsid, strlen(clsid)); + snprintf(module, sizeof(module), "{%s}", clsid); + RegSetValueExA(subkey, NULL, 0, REG_SZ, module, strlen(module)); RegCloseKey(subkey); } RegCloseKey(key); @@ -177,7 +180,7 @@ } /* register clsid to point to module */ - snprintf(keyname, sizeof(keyname), "CLSID\\%s", clsid); + snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); GetModuleFileNameA(hDll, module, sizeof(module)); TRACE("registering CLSID %s => %s\n", clsid, module); if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, @@ -219,7 +222,7 @@ TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); UuidToStringA((UUID*)proxy->header.piid, &iid); - snprintf(keyname, sizeof(keyname), "Interface\\%s", iid); + snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); RpcStringFreeA(&iid); RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); } @@ -227,7 +230,7 @@ } /* unregister clsid */ - snprintf(keyname, sizeof(keyname), "CLSID\\%s", clsid); + snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); GetModuleFileNameA(hDll, module, sizeof(module)); TRACE("unregistering CLSID %s <= %s\n", clsid, module); RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); Index: dlls/rpcrt4/cpsf.h =================================================================== RCS file: /cvsroot/rewind/rewind/dlls/rpcrt4/cpsf.h,v retrieving revision 1.1 diff -u -r1.1 cpsf.h --- dlls/rpcrt4/cpsf.h 31 Oct 2002 21:28:17 -0000 1.1 +++ dlls/rpcrt4/cpsf.h 19 May 2003 22:29:00 -0000 @@ -9,6 +9,7 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid, LPUNKNOWN pUnkOuter, + PCInterfaceName name, CInterfaceProxyVtbl *vtbl, CInterfaceStubVtbl *svtbl, LPPSFACTORYBUFFER pPSFactory, @@ -21,6 +22,7 @@ HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, + PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub); Index: dlls/rpcrt4/cstub.c =================================================================== RCS file: /cvsroot/rewind/rewind/dlls/rpcrt4/cstub.c,v retrieving revision 1.3 diff -u -r1.3 cstub.c --- dlls/rpcrt4/cstub.c 19 Apr 2003 12:18:20 -0000 1.3 +++ dlls/rpcrt4/cstub.c 19 May 2003 22:29:00 -0000 @@ -22,13 +22,14 @@ HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, + PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub) { CStdStubBuffer *This; - TRACE("(%p,%p,%p,%p)\n", pUnkServer, vtbl, pPSFactory, ppStub); + TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name); TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); TRACE("vtbl=%p\n", &vtbl->Vtbl);