mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
ole32: Fix the return value of COM_RegReadPath and make it static.
This commit is contained in:
parent
ef7b6e2740
commit
5f453db5cf
@ -1540,25 +1540,25 @@ end:
|
|||||||
*
|
*
|
||||||
* Reads a registry value and expands it when necessary
|
* Reads a registry value and expands it when necessary
|
||||||
*/
|
*/
|
||||||
HRESULT COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *valuename, WCHAR * dst, DWORD dstlen)
|
static DWORD COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *valuename, WCHAR * dst, DWORD dstlen)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
DWORD ret;
|
||||||
HKEY key;
|
HKEY key;
|
||||||
DWORD keytype;
|
DWORD keytype;
|
||||||
WCHAR src[MAX_PATH];
|
WCHAR src[MAX_PATH];
|
||||||
DWORD dwLength = dstlen * sizeof(WCHAR);
|
DWORD dwLength = dstlen * sizeof(WCHAR);
|
||||||
|
|
||||||
if((hres = RegOpenKeyExW(hkeyroot, keyname, 0, KEY_READ, &key)) == ERROR_SUCCESS) {
|
if((ret = RegOpenKeyExW(hkeyroot, keyname, 0, KEY_READ, &key)) == ERROR_SUCCESS) {
|
||||||
if( (hres = RegQueryValueExW(key, NULL, NULL, &keytype, (LPBYTE)src, &dwLength)) == ERROR_SUCCESS ) {
|
if( (ret = RegQueryValueExW(key, NULL, NULL, &keytype, (LPBYTE)src, &dwLength)) == ERROR_SUCCESS ) {
|
||||||
if (keytype == REG_EXPAND_SZ) {
|
if (keytype == REG_EXPAND_SZ) {
|
||||||
if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) hres = ERROR_MORE_DATA;
|
if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA;
|
||||||
} else {
|
} else {
|
||||||
lstrcpynW(dst, src, dstlen);
|
lstrcpynW(dst, src, dstlen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegCloseKey (key);
|
RegCloseKey (key);
|
||||||
}
|
}
|
||||||
return hres;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT get_inproc_class_object(HKEY hkeydll, REFCLSID rclsid, REFIID riid, void **ppv)
|
static HRESULT get_inproc_class_object(HKEY hkeydll, REFCLSID rclsid, REFIID riid, void **ppv)
|
||||||
|
Loading…
Reference in New Issue
Block a user