mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
w32: Remove unused code.
* jnlib/w32-reg.c (write_w32_registry_string): Remove.
This commit is contained in:
parent
9942a149ff
commit
63b7658a29
@ -223,102 +223,4 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
|
||||
}
|
||||
|
||||
|
||||
/* Note: This code is not well tested. However, it is not used in
|
||||
GnuPG. */
|
||||
#if 0
|
||||
int
|
||||
write_w32_registry_string (const char *root, const char *dir,
|
||||
const char *name, const char *value)
|
||||
{
|
||||
HKEY root_key, reg_key;
|
||||
#ifdef HAVE_W32CE_SYSTEM
|
||||
wchar_t *wdir, *wname, *wvalue;
|
||||
DWORD disp;
|
||||
|
||||
if ( !(root_key = get_root_key(root) ) )
|
||||
return -1;
|
||||
|
||||
wdir = utf8_to_wchar (dir);
|
||||
if (!wdir)
|
||||
return -1;
|
||||
|
||||
if (RegOpenKeyEx (root_key, wdir, 0, 0, ®_key))
|
||||
{
|
||||
jnlib_free (wdir);
|
||||
return -1;
|
||||
}
|
||||
jnlib_free (wdir);
|
||||
|
||||
if (name)
|
||||
{
|
||||
wname = utf8_to_wchar (name);
|
||||
if (!wname)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
wname = NULL;
|
||||
|
||||
wvalue = utf8_to_wchar (value);
|
||||
if (wvalue)
|
||||
{
|
||||
jnlib_free (wname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (RegSetValueEx (reg_key, wname, 0, REG_SZ,
|
||||
(BYTE *)wvalue, wcslen (wvalue)) != ERROR_SUCCESS )
|
||||
{
|
||||
|
||||
if (RegCreateKeyEx (root_key, wname, 0, NULL, 0, 0, NULL,
|
||||
®_key, &disp) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(reg_key);
|
||||
jnlib_free (wname);
|
||||
jnlib_free (wvalue);
|
||||
return -1;
|
||||
}
|
||||
if (RegSetValueEx (reg_key, wname, 0, REG_SZ,
|
||||
(BYTE *)wvalue, wcslen (wvalue)) != ERROR_SUCCESS )
|
||||
{
|
||||
RegCloseKey(reg_key);
|
||||
jnlib_free (wname);
|
||||
jnlib_free (wvalue);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
jnlib_free (wname);
|
||||
jnlib_free (wvalue);
|
||||
RegCloseKey (reg_key);
|
||||
return 0;
|
||||
#else /*!HAVE_W32CE_SYSTEM*/
|
||||
|
||||
if ( !(root_key = get_root_key(root) ) )
|
||||
return -1;
|
||||
|
||||
if ( RegOpenKeyEx( root_key, dir, 0, KEY_WRITE, ®_key )
|
||||
!= ERROR_SUCCESS )
|
||||
return -1;
|
||||
|
||||
if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
|
||||
strlen( value ) ) != ERROR_SUCCESS )
|
||||
{
|
||||
if ( RegCreateKey( root_key, name, ®_key ) != ERROR_SUCCESS )
|
||||
{
|
||||
RegCloseKey(reg_key);
|
||||
return -1;
|
||||
}
|
||||
if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
|
||||
strlen( value ) ) != ERROR_SUCCESS )
|
||||
{
|
||||
RegCloseKey(reg_key);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
RegCloseKey (reg_key);
|
||||
return 0;
|
||||
#endif /*!HAVE_W32CE_SYSTEM*/
|
||||
}
|
||||
#endif /*0*/
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user