Skip to content
Snippets Groups Projects
Commit db9d41e5 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'fix-windows-prefs-permissions'

parents f29d9394 4628ff41
No related branches found
No related tags found
No related merge requests found
...@@ -189,11 +189,16 @@ static int sys_getpreference(const char *key, char *value, int size) ...@@ -189,11 +189,16 @@ static int sys_getpreference(const char *key, char *value, int size)
{ {
HKEY hkey; HKEY hkey;
DWORD bigsize = size; DWORD bigsize = size;
LONG err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, LONG err = RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Purr-Data", 0, KEY_QUERY_VALUE, &hkey); "Software\\Purr-Data", 0, KEY_QUERY_VALUE, &hkey);
if (err != ERROR_SUCCESS) if (err != ERROR_SUCCESS)
{ {
return (0); err = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"Software\\Purr-Data", 0, KEY_QUERY_VALUE, &hkey);
if (err != ERROR_SUCCESS)
{
return (0);
}
} }
err = RegQueryValueEx(hkey, key, 0, 0, value, &bigsize); err = RegQueryValueEx(hkey, key, 0, 0, value, &bigsize);
if (err != ERROR_SUCCESS) if (err != ERROR_SUCCESS)
...@@ -216,7 +221,7 @@ static void sys_initsavepreferences( void) ...@@ -216,7 +221,7 @@ static void sys_initsavepreferences( void)
static void sys_putpreference(const char *key, const char *value) static void sys_putpreference(const char *key, const char *value)
{ {
HKEY hkey; HKEY hkey;
LONG err = RegCreateKeyEx(HKEY_LOCAL_MACHINE, LONG err = RegCreateKeyEx(HKEY_CURRENT_USER,
"Software\\Purr-Data", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, "Software\\Purr-Data", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE,
NULL, &hkey, NULL); NULL, &hkey, NULL);
if (err != ERROR_SUCCESS) if (err != ERROR_SUCCESS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment