Simplified reg handling in CoGetClassObject, do not use RegQueryValueW.
This commit is contained in:
parent
8f1e39f3a7
commit
93734bcdc3
|
@ -1200,31 +1200,21 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext) {
|
if ((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext) {
|
||||||
HKEY CLSIDkey,key;
|
HKEY key;
|
||||||
WCHAR valname[]={ 'I','n','p','r','o','c',
|
char buf[200];
|
||||||
'S','e','r','v','e','r','3','2',0};
|
|
||||||
|
|
||||||
/* lookup CLSID in registry key HKCR/CLSID */
|
sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
|
||||||
hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID", 0,
|
hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
|
||||||
KEY_READ, &CLSIDkey);
|
|
||||||
|
|
||||||
if (hres != ERROR_SUCCESS)
|
|
||||||
return REGDB_E_READREGDB;
|
|
||||||
hres = RegOpenKeyExA(CLSIDkey,xclsid,0,KEY_QUERY_VALUE,&key);
|
|
||||||
if (hres != ERROR_SUCCESS) {
|
if (hres != ERROR_SUCCESS) {
|
||||||
RegCloseKey(CLSIDkey);
|
|
||||||
return REGDB_E_CLASSNOTREG;
|
return REGDB_E_CLASSNOTREG;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(dllName,0,sizeof(dllName));
|
memset(dllName,0,sizeof(dllName));
|
||||||
hres = RegQueryValueW(key, valname, dllName, &dllNameLen);
|
hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
|
||||||
if (hres) {
|
if (hres)
|
||||||
ERR("RegQueryValue of %s failed with hres %lx\n",debugstr_w(dllName),hres);
|
|
||||||
return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
|
return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
|
||||||
}
|
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
RegCloseKey(CLSIDkey);
|
|
||||||
if (hres != ERROR_SUCCESS)
|
|
||||||
return REGDB_E_READREGDB;
|
|
||||||
TRACE("found InprocServer32 dll %s\n", debugstr_w(dllName));
|
TRACE("found InprocServer32 dll %s\n", debugstr_w(dllName));
|
||||||
|
|
||||||
/* open dll, call DllGetClassObject */
|
/* open dll, call DllGetClassObject */
|
||||||
|
|
Loading…
Reference in New Issue