Commit 6ea7932c authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Implemented CoTreatAsClass, simplified OleSetAutoConvert.

parent edb8bdb5
......@@ -2125,11 +2125,11 @@ done:
*/
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,25 +2137,46 @@ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
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]
*
......
......@@ -58,15 +58,6 @@ HRESULT WINAPI OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame,
}
/******************************************************************************
* 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)
......
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