Commit 449308ec authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Avoid touching the output value on failure in get_config_key_dword();.

parent c09bb22c
......@@ -127,13 +127,20 @@ static DWORD get_config_key(HKEY defkey, HKEY appkey, const char *name, char *bu
return ERROR_FILE_NOT_FOUND;
}
static DWORD get_config_key_dword(HKEY defkey, HKEY appkey, const char *name, DWORD *data)
static DWORD get_config_key_dword(HKEY defkey, HKEY appkey, const char *name, DWORD *value)
{
DWORD type;
DWORD size = sizeof(DWORD);
if (appkey && !RegQueryValueExA(appkey, name, 0, &type, (BYTE *)data, &size) && (type == REG_DWORD)) return 0;
if (defkey && !RegQueryValueExA(defkey, name, 0, &type, (BYTE *)data, &size) && (type == REG_DWORD)) return 0;
DWORD type, data, size;
size = sizeof(data);
if (appkey && !RegQueryValueExA(appkey, name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD) goto success;
size = sizeof(data);
if (defkey && !RegQueryValueExA(defkey, name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD) goto success;
return ERROR_FILE_NOT_FOUND;
success:
*value = data;
return 0;
}
static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
......
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