Hi, CoTreatAsClass just sets a respective registry key, just like OleSetAutoConvert. RegCreateKeyA, RegSetValueExA can be merged into RegSetValueA -> done. Ciao, Marcus Changelog: Implemented CoTreatAsClass, simplified OleSetAutoConvert. Index: ole2stubs.c =================================================================== RCS file: /home/wine/wine/dlls/ole32/ole2stubs.c,v retrieving revision 1.18 diff -u -r1.18 ole2stubs.c --- ole2stubs.c 2001/06/20 23:03:16 1.18 +++ ole2stubs.c 2002/01/02 21:23:16 @@ -58,15 +58,6 @@ } /****************************************************************************** - * CoTreatAsClass [OLE32.46] - */ -HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) -{ - FIXME("(%p,%p), stub!\n", clsidOld, clsidNew); - return S_OK; -} - -/****************************************************************************** * SetConvertStg [OLE32.142] */ HRESULT WINAPI SetConvertStg(LPSTORAGE pStg, BOOL fConvert) Index: compobj.c =================================================================== RCS file: /home/wine/wine/dlls/ole32/compobj.c,v retrieving revision 1.49 diff -u -r1.49 compobj.c --- compobj.c 2002/01/01 00:24:31 1.49 +++ compobj.c 2002/01/02 21:23:18 @@ -2125,11 +2125,11 @@ */ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew) { - HKEY hkey = 0, hkeyConvert = 0; + HKEY hkey = 0; char buf[200], szClsidNew[200]; HRESULT res = S_OK; - TRACE("(%p,%p);\n", clsidOld, clsidNew); + TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew)); sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]); WINE_StringFromCLSID(clsidNew, szClsidNew); if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey)) @@ -2137,24 +2137,45 @@ res = REGDB_E_CLASSNOTREG; goto done; } - if (RegCreateKeyA(hkey, "AutoConvertTo", &hkeyConvert)) + if (RegSetValueA(hkey, "AutoConvertTo", REG_SZ, szClsidNew, strlen(szClsidNew)+1)) { res = REGDB_E_WRITEREGDB; goto done; } - if (RegSetValueExA(hkeyConvert, NULL, 0, - REG_SZ, (LPBYTE)szClsidNew, strlen(szClsidNew)+1)) + +done: + if (hkey) RegCloseKey(hkey); + return res; +} + +/****************************************************************************** + * CoTreatAsClass [OLE32.46] + */ +HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) +{ + HKEY hkey = 0; + char buf[200], szClsidNew[200]; + HRESULT res = S_OK; + + FIXME("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew)); + sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]); + WINE_StringFromCLSID(clsidNew, szClsidNew); + if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey)) { + res = REGDB_E_CLASSNOTREG; + goto done; + } + if (RegSetValueA(hkey, "AutoTreatAs", REG_SZ, szClsidNew, strlen(szClsidNew)+1)) + { res = REGDB_E_WRITEREGDB; goto done; } done: - if (hkeyConvert) RegCloseKey(hkeyConvert); if (hkey) RegCloseKey(hkey); - return res; } + /*********************************************************************** * IsEqualGUID [OLE32.76]