mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-07 17:33:02 +01:00
* w32reg.c (read_w32_registry_string): Fallback to HLM.
This commit is contained in:
parent
81c8f7daca
commit
6794524789
@ -1,3 +1,7 @@
|
|||||||
|
2002-09-16 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* w32reg.c (read_w32_registry_string): Fallback to HLM.
|
||||||
|
|
||||||
2002-09-12 Stefan Bellon <sbellon@sbellon.de>
|
2002-09-12 Stefan Bellon <sbellon@sbellon.de>
|
||||||
|
|
||||||
* fileutil.c (make_filename): Removed variable for RISC OS to
|
* fileutil.c (make_filename): Removed variable for RISC OS to
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* w32reg.c - MS-Windows Registry access
|
/* w32reg.c - MS-Windows Registry access
|
||||||
* Copyright (C) 1999 Free Software Foundation, Inc.
|
* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -59,7 +59,7 @@ get_root_key(const char *root)
|
|||||||
/****************
|
/****************
|
||||||
* Return a string from the Win32 Registry or NULL in case of
|
* Return a string from the Win32 Registry or NULL in case of
|
||||||
* error. Caller must release the return value. A NULL for root
|
* error. Caller must release the return value. A NULL for root
|
||||||
* is an alias fro HKEY_CURRENT_USER
|
* is an alias for HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE in turn.
|
||||||
* NOTE: The value is allocated with a plain malloc() - use free() and not
|
* NOTE: The value is allocated with a plain malloc() - use free() and not
|
||||||
* the usual m_free()!!!
|
* the usual m_free()!!!
|
||||||
*/
|
*/
|
||||||
@ -74,7 +74,13 @@ read_w32_registry_string( const char *root, const char *dir, const char *name )
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if( RegOpenKeyEx( root_key, dir, 0, KEY_READ, &key_handle ) )
|
if( RegOpenKeyEx( root_key, dir, 0, KEY_READ, &key_handle ) )
|
||||||
return NULL; /* no need for a RegClose, so return direct */
|
{
|
||||||
|
if (root)
|
||||||
|
return NULL; /* no need for a RegClose, so return direct */
|
||||||
|
/* It seems to be common practise to fall back to HLM. */
|
||||||
|
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &key_handle) )
|
||||||
|
return NULL; /* still no need for a RegClose, so return direct */
|
||||||
|
}
|
||||||
|
|
||||||
nbytes = 1;
|
nbytes = 1;
|
||||||
if( RegQueryValueEx( key_handle, name, 0, NULL, NULL, &nbytes ) )
|
if( RegQueryValueEx( key_handle, name, 0, NULL, NULL, &nbytes ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user