Implemented CoGetPSClsid().

This commit is contained in:
James Hatheway 2000-09-01 01:21:08 +00:00 committed by Alexandre Julliard
parent 67019ae03d
commit e0849c8a52
2 changed files with 70 additions and 1 deletions

View File

@ -756,6 +756,75 @@ HRESULT WINAPI CLSIDFromProgID(
return ret; return ret;
} }
/*****************************************************************************
* CoGetPSClsid [OLE32.22]
*
* This function returns the CLSID of the DLL that implements the proxy and stub
* for the specified interface.
*
* It determines this by searching the
* HKEY_CLASSES_ROOT\Interface\{string form of riid}\ProxyStubClsid32 in the registry
* and any interface id registered by CoRegisterPSClsid within the current process.
*
* FIXME: We only search the registry, not ids registered with CoRegisterPSClsid.
*/
HRESULT WINAPI CoGetPSClsid(
REFIID riid, /* [in] Interface whose proxy/stub CLSID is to be returned */
CLSID *pclsid ) /* [out] Where to store returned proxy/stub CLSID */
{
char *buf, buf2[40];
DWORD buf2len;
HKEY xhkey;
TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid);
/* Get the input iid as a string */
WINE_StringFromCLSID(riid, buf2);
/* Allocate memory for the registry key we will construct.
(length of iid string plus constant length of static text */
buf = HeapAlloc(GetProcessHeap(), 0, strlen(buf2)+27);
if (buf == NULL)
{
return (E_OUTOFMEMORY);
}
/* Construct the registry key we want */
sprintf(buf,"Interface\\%s\\ProxyStubClsid32", buf2);
/* Open the key.. */
if (RegOpenKeyA(HKEY_CLASSES_ROOT, buf, &xhkey))
{
HeapFree(GetProcessHeap(),0,buf);
return (E_INVALIDARG);
}
HeapFree(GetProcessHeap(),0,buf);
/* ... Once we have the key, query the registry to get the
value of CLSID as a string, and convert it into a
proper CLSID structure to be passed back to the app */
buf2len = sizeof(buf2);
if ( (RegQueryValueA(xhkey,NULL,buf2,&buf2len)) )
{
RegCloseKey(xhkey);
return E_INVALIDARG;
}
RegCloseKey(xhkey);
/* We have the CLSid we want back from the registry as a string, so
lets convert it into a CLSID structure */
if ( (CLSIDFromString16(buf2,pclsid)) != NOERROR)
{
return E_INVALIDARG;
}
TRACE ("() Returning CLSID=%s\n", debugstr_guid(pclsid));
return (S_OK);
}
/*********************************************************************** /***********************************************************************
* WriteClassStm * WriteClassStm
* *

View File

@ -28,7 +28,7 @@ import kernel32.dll
19 stub CoGetInterfaceAndReleaseStream # stdcall (ptr ptr ptr) return 0,ERR_NOTIMPLEMENTED 19 stub CoGetInterfaceAndReleaseStream # stdcall (ptr ptr ptr) return 0,ERR_NOTIMPLEMENTED
20 stdcall CoGetMalloc(long ptr) CoGetMalloc 20 stdcall CoGetMalloc(long ptr) CoGetMalloc
21 stub CoGetMarshalSizeMax # stdcall (ptr ptr ptr long ptr long) return 0,ERR_NOTIMPLEMENTED 21 stub CoGetMarshalSizeMax # stdcall (ptr ptr ptr long ptr long) return 0,ERR_NOTIMPLEMENTED
22 stub CoGetPSClsid # stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED 22 stdcall CoGetPSClsid(ptr ptr) CoGetPSClsid
23 stub CoGetStandardMarshal # stdcall (ptr ptr long ptr long ptr) return 0,ERR_NOTIMPLEMENTED 23 stub CoGetStandardMarshal # stdcall (ptr ptr long ptr long ptr) return 0,ERR_NOTIMPLEMENTED
24 stub CoGetState 24 stub CoGetState
25 stub CoGetTreatAsClass # stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED 25 stub CoGetTreatAsClass # stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED