winex11: Avoid using sprintfW.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
17afa30577
commit
30d5a04f6d
|
@ -1053,7 +1053,6 @@ static int find_fallback_shape( const char *name )
|
||||||
*/
|
*/
|
||||||
static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
|
static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
|
||||||
{
|
{
|
||||||
static const WCHAR idW[] = {'%','h','u',0};
|
|
||||||
const struct system_cursors *cursors;
|
const struct system_cursors *cursors;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
Cursor cursor = 0;
|
Cursor cursor = 0;
|
||||||
|
@ -1070,7 +1069,12 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info )
|
||||||
p = name + strlenW( name );
|
p = name + strlenW( name );
|
||||||
*p++ = ',';
|
*p++ = ',';
|
||||||
if (info->szResName[0]) strcpyW( p, info->szResName );
|
if (info->szResName[0]) strcpyW( p, info->szResName );
|
||||||
else sprintfW( p, idW, info->wResID );
|
else
|
||||||
|
{
|
||||||
|
char buf[16];
|
||||||
|
sprintf( buf, "%hu", info->wResID );
|
||||||
|
asciiz_to_unicode( p, buf );
|
||||||
|
}
|
||||||
valueA[0] = 0;
|
valueA[0] = 0;
|
||||||
|
|
||||||
/* @@ Wine registry key: HKCU\Software\Wine\X11 Driver\Cursors */
|
/* @@ Wine registry key: HKCU\Software\Wine\X11 Driver\Cursors */
|
||||||
|
|
|
@ -217,8 +217,6 @@ void init_registry_display_settings(void)
|
||||||
static HKEY get_display_device_reg_key( const WCHAR *device_name )
|
static HKEY get_display_device_reg_key( const WCHAR *device_name )
|
||||||
{
|
{
|
||||||
static const WCHAR display[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y'};
|
static const WCHAR display[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y'};
|
||||||
static const WCHAR video_value_fmt[] = {'\\','D','e','v','i','c','e','\\',
|
|
||||||
'V','i','d','e','o','%','d',0};
|
|
||||||
static const WCHAR video_key[] = {
|
static const WCHAR video_key[] = {
|
||||||
'\\','R','e','g','i','s','t','r','y',
|
'\\','R','e','g','i','s','t','r','y',
|
||||||
'\\','M','a','c','h','i','n','e',
|
'\\','M','a','c','h','i','n','e',
|
||||||
|
@ -235,6 +233,7 @@ static HKEY get_display_device_reg_key( const WCHAR *device_name )
|
||||||
WCHAR value_name[MAX_PATH], buffer[4096], *end_ptr;
|
WCHAR value_name[MAX_PATH], buffer[4096], *end_ptr;
|
||||||
KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer;
|
KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer;
|
||||||
DWORD adapter_index, size;
|
DWORD adapter_index, size;
|
||||||
|
char adapter_name[100];
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
|
||||||
/* Device name has to be \\.\DISPLAY%d */
|
/* Device name has to be \\.\DISPLAY%d */
|
||||||
|
@ -248,7 +247,8 @@ static HKEY get_display_device_reg_key( const WCHAR *device_name )
|
||||||
|
|
||||||
/* Open \Device\Video* in HKLM\HARDWARE\DEVICEMAP\VIDEO\ */
|
/* Open \Device\Video* in HKLM\HARDWARE\DEVICEMAP\VIDEO\ */
|
||||||
if (!(hkey = reg_open_key( NULL, video_key, sizeof(video_key) ))) return FALSE;
|
if (!(hkey = reg_open_key( NULL, video_key, sizeof(video_key) ))) return FALSE;
|
||||||
sprintfW(value_name, video_value_fmt, adapter_index);
|
sprintf( adapter_name, "\\Device\\Video%d", adapter_index );
|
||||||
|
asciiz_to_unicode( value_name, adapter_name );
|
||||||
size = query_reg_value( hkey, value_name, value, sizeof(buffer) );
|
size = query_reg_value( hkey, value_name, value, sizeof(buffer) );
|
||||||
NtClose( hkey );
|
NtClose( hkey );
|
||||||
if (!size || value->Type != REG_SZ) return FALSE;
|
if (!size || value->Type != REG_SZ) return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue