Commit e614610a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Introduce and use new reg_(open|create)_ascii_key helpers.

parent 6b8b35f9
......@@ -516,6 +516,12 @@ HKEY reg_open_key( HKEY root, const WCHAR *name, ULONG name_len )
return ret;
}
HKEY reg_open_ascii_key( HKEY root, const char *name )
{
WCHAR nameW[MAX_PATH];
return reg_open_key( root, nameW, asciiz_to_unicode( nameW, name ) - sizeof(WCHAR) );
}
/* wrapper for NtCreateKey that creates the key recursively if necessary */
HKEY reg_create_key( HKEY root, const WCHAR *name, ULONG name_len,
DWORD options, DWORD *disposition )
......@@ -565,10 +571,17 @@ HKEY reg_create_key( HKEY root, const WCHAR *name, ULONG name_len,
return ret;
}
HKEY reg_create_ascii_key( HKEY root, const char *name, DWORD options,
DWORD *disposition )
{
WCHAR nameW[MAX_PATH];
return reg_create_key( root, nameW, asciiz_to_unicode( nameW, name ) - sizeof(WCHAR),
options, disposition );
}
HKEY reg_open_hkcu_key( const char *name )
{
WCHAR nameW[128];
return reg_open_key( hkcu_key, nameW, asciiz_to_unicode( nameW, name ) - sizeof(WCHAR) );
return reg_open_ascii_key( hkcu_key, name );
}
BOOL set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value, DWORD count )
......
......@@ -260,8 +260,11 @@ extern int muldiv( int a, int b, int c );
extern HKEY reg_create_key( HKEY root, const WCHAR *name, ULONG name_len,
DWORD options, DWORD *disposition );
extern HKEY reg_create_ascii_key( HKEY root, const char *name, DWORD options,
DWORD *disposition );
extern HKEY reg_open_hkcu_key( const char *name );
extern HKEY reg_open_key( HKEY root, const WCHAR *name, ULONG name_len );
extern HKEY reg_open_ascii_key( HKEY root, const char *name );
extern ULONG query_reg_value( HKEY hkey, const WCHAR *name,
KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size );
extern ULONG query_reg_ascii_value( HKEY hkey, const char *name,
......
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