Implemented CoGetTreatAsClass.

This commit is contained in:
Marcus Meissner 2003-01-11 20:58:10 +00:00 committed by Alexandre Julliard
parent d26933edbd
commit 27627d977e
2 changed files with 35 additions and 1 deletions

View File

@ -1863,6 +1863,40 @@ done:
return res; return res;
} }
/******************************************************************************
* CoGetTreatAsClass [OLE32.25]
*
* Reads the TreatAs value from a class.
*/
HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
{
HKEY hkey = 0;
char buf[200], szClsidNew[200];
HRESULT res = S_OK;
LONG len = sizeof(szClsidNew);
FIXME("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew);
sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
memcpy(clsidNew,clsidOld,sizeof(CLSID)); /* copy over old value */
if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
{
res = REGDB_E_CLASSNOTREG;
goto done;
}
if (RegQueryValueA(hkey, "TreatAs", szClsidNew, &len))
{
res = S_FALSE;
goto done;
}
res = __CLSIDFromStringA(szClsidNew,clsidNew);
if (FAILED(res))
FIXME("Failed CLSIDFromStringA(%s), hres %lx?\n",szClsidNew,res);
done:
if (hkey) RegCloseKey(hkey);
return res;
}
/*********************************************************************** /***********************************************************************
* IsEqualGUID [OLE32.76] * IsEqualGUID [OLE32.76]

View File

@ -22,7 +22,7 @@
22 stdcall CoGetPSClsid(ptr ptr) CoGetPSClsid 22 stdcall CoGetPSClsid(ptr ptr) CoGetPSClsid
23 stdcall CoGetStandardMarshal(ptr ptr long ptr long ptr) CoGetStandardMarshal 23 stdcall CoGetStandardMarshal(ptr ptr long ptr long ptr) CoGetStandardMarshal
24 stdcall CoGetState(ptr) CoGetState 24 stdcall CoGetState(ptr) CoGetState
25 stub CoGetTreatAsClass # stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED 25 stdcall CoGetTreatAsClass(ptr ptr) CoGetTreatAsClass
26 stdcall CoInitialize(ptr) CoInitialize 26 stdcall CoInitialize(ptr) CoInitialize
27 stdcall CoInitializeWOW(long long) CoInitializeWOW 27 stdcall CoInitializeWOW(long long) CoInitializeWOW
28 stub CoIsHandlerConnected # stdcall (ptr) return 0,ERR_NOTIMPLEMENTED 28 stub CoIsHandlerConnected # stdcall (ptr) return 0,ERR_NOTIMPLEMENTED