From: Eric Pouech eric.pouech@gmail.com
GCC12.* emits tons of warnings when compiling win32'u sysparam bits These warnings stem from: - a union of different structures - allocating one instance of these structure and casting its address to a pointer to the union.
This is UB as the whole union should be allocated in order to be a valid object.
I tried to keep the original goals: - don't overallocate individual structures - have an OO design (and avoid casting back & forth arguments in methods) and implemented this fix by transforming (as argument to most of the methods) - a pointer to an union of structs into - an union (passed by value) of pointers to structs
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/win32u/sysparams.c | 903 ++++++++++++++++++++-------------------- 1 file changed, 454 insertions(+), 449 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index b68bfa3a7ce..19eb37922ea 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -280,9 +280,9 @@ union sysparam_all_entry;
struct sysparam_entry { - BOOL (*get)( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ); - BOOL (*set)( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ); - BOOL (*init)( union sysparam_all_entry *entry ); + BOOL (*get)( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ); + BOOL (*set)( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ); + BOOL (*init)( union sysparam_all_entry entry ); enum parameter_key base_key; const char *regval; enum parameter_key mirror_key; @@ -347,15 +347,15 @@ struct sysparam_pref_entry
union sysparam_all_entry { - struct sysparam_entry hdr; - struct sysparam_uint_entry uint; - struct sysparam_bool_entry bool; - struct sysparam_dword_entry dword; - struct sysparam_rgb_entry rgb; - struct sysparam_binary_entry bin; - struct sysparam_path_entry path; - struct sysparam_font_entry font; - struct sysparam_pref_entry pref; + struct sysparam_entry *hdr; + struct sysparam_uint_entry *uint; + struct sysparam_bool_entry *bool; + struct sysparam_dword_entry *dword; + struct sysparam_rgb_entry *rgb; + struct sysparam_binary_entry *bin; + struct sysparam_path_entry *path; + struct sysparam_font_entry *font; + struct sysparam_pref_entry *pref; };
static UINT system_dpi; @@ -2338,80 +2338,80 @@ static BOOL init_entry_string( struct sysparam_entry *entry, const WCHAR *str ) }
/* set an int parameter in the registry */ -static BOOL set_int_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_int_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { WCHAR bufW[32]; char buf[32];
sprintf( buf, "%d", int_param ); asciiz_to_unicode( bufW, buf ); - if (!save_entry_string( &entry->hdr, bufW, flags )) return FALSE; - entry->uint.val = int_param; - entry->hdr.loaded = TRUE; + if (!save_entry_string( entry.hdr, bufW, flags )) return FALSE; + entry.uint->val = int_param; + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize an int parameter */ -static BOOL init_int_entry( union sysparam_all_entry *entry ) +static BOOL init_int_entry( union sysparam_all_entry entry ) { WCHAR bufW[32]; char buf[32];
- sprintf( buf, "%d", entry->uint.val ); + sprintf( buf, "%d", entry.uint->val ); asciiz_to_unicode( bufW, buf ); - return init_entry_string( &entry->hdr, bufW ); + return init_entry_string( entry.hdr, bufW ); }
/* load a uint parameter from the registry */ -static BOOL get_uint_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_uint_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buf[32]; - if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->uint.val = wcstol( buf, NULL, 10 ); + if (load_entry( entry.hdr, buf, sizeof(buf) )) entry.uint->val = wcstol( buf, NULL, 10 ); } - *(UINT *)ptr_param = entry->uint.val; + *(UINT *)ptr_param = entry.uint->val; return TRUE; }
/* set a uint parameter in the registry */ -static BOOL set_uint_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_uint_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { WCHAR bufW[32]; char buf[32];
sprintf( buf, "%u", int_param ); asciiz_to_unicode( bufW, buf ); - if (!save_entry_string( &entry->hdr, bufW, flags )) return FALSE; - entry->uint.val = int_param; - entry->hdr.loaded = TRUE; + if (!save_entry_string( entry.hdr, bufW, flags )) return FALSE; + entry.uint->val = int_param; + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize a uint parameter */ -static BOOL init_uint_entry( union sysparam_all_entry *entry ) +static BOOL init_uint_entry( union sysparam_all_entry entry ) { WCHAR bufW[32]; char buf[32];
- sprintf( buf, "%u", entry->uint.val ); + sprintf( buf, "%u", entry.uint->val ); asciiz_to_unicode( bufW, buf ); - return init_entry_string( &entry->hdr, bufW ); + return init_entry_string( entry.hdr, bufW ); }
/* load a twips parameter from the registry */ -static BOOL get_twips_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_twips_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { int val;
if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buf[32]; - if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->uint.val = wcstol( buf, NULL, 10 ); + if (load_entry( entry.hdr, buf, sizeof(buf) )) entry.uint->val = wcstol( buf, NULL, 10 ); }
/* Dimensions are quoted as being "twips" values if negative and pixels if positive. @@ -2420,7 +2420,7 @@ static BOOL get_twips_entry( union sysparam_all_entry *entry, UINT int_param, vo * Technical Reference to the Windows 2000 Registry -> * HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics */ - val = entry->uint.val; + val = entry.uint->val; if (val < 0) val = muldiv( -val, dpi, 1440 ); else @@ -2431,7 +2431,7 @@ static BOOL get_twips_entry( union sysparam_all_entry *entry, UINT int_param, vo }
/* set a twips parameter in the registry */ -static BOOL set_twips_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_twips_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { int val = int_param; if (val > 0) val = map_from_system_dpi( val ); @@ -2439,110 +2439,110 @@ static BOOL set_twips_entry( union sysparam_all_entry *entry, UINT int_param, vo }
/* load a bool parameter from the registry */ -static BOOL get_bool_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_bool_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buf[32]; - if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->bool.val = wcstol( buf, NULL, 10 ) != 0; + if (load_entry( entry.hdr, buf, sizeof(buf) )) entry.bool->val = wcstol( buf, NULL, 10 ) != 0; } - *(UINT *)ptr_param = entry->bool.val; + *(UINT *)ptr_param = entry.bool->val; return TRUE; }
/* set a bool parameter in the registry */ -static BOOL set_bool_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_bool_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { WCHAR buf[] = { int_param ? '1' : '0', 0 };
- if (!save_entry_string( &entry->hdr, buf, flags )) return FALSE; - entry->bool.val = int_param != 0; - entry->hdr.loaded = TRUE; + if (!save_entry_string( entry.hdr, buf, flags )) return FALSE; + entry.bool->val = int_param != 0; + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize a bool parameter */ -static BOOL init_bool_entry( union sysparam_all_entry *entry ) +static BOOL init_bool_entry( union sysparam_all_entry entry ) { - WCHAR buf[] = { entry->bool.val ? '1' : '0', 0 }; + WCHAR buf[] = { entry.bool->val ? '1' : '0', 0 };
- return init_entry_string( &entry->hdr, buf ); + return init_entry_string( entry.hdr, buf ); }
/* load a bool parameter using Yes/No strings from the registry */ -static BOOL get_yesno_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_yesno_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buf[32]; - if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->bool.val = !wcsicmp( yesW, buf ); + if (load_entry( entry.hdr, buf, sizeof(buf) )) entry.bool->val = !wcsicmp( yesW, buf ); } - *(UINT *)ptr_param = entry->bool.val; + *(UINT *)ptr_param = entry.bool->val; return TRUE; }
/* set a bool parameter using Yes/No strings from the registry */ -static BOOL set_yesno_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_yesno_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { const WCHAR *str = int_param ? yesW : noW;
- if (!save_entry_string( &entry->hdr, str, flags )) return FALSE; - entry->bool.val = int_param != 0; - entry->hdr.loaded = TRUE; + if (!save_entry_string( entry.hdr, str, flags )) return FALSE; + entry.bool->val = int_param != 0; + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize a bool parameter using Yes/No strings */ -static BOOL init_yesno_entry( union sysparam_all_entry *entry ) +static BOOL init_yesno_entry( union sysparam_all_entry entry ) { - return init_entry_string( &entry->hdr, entry->bool.val ? yesW : noW ); + return init_entry_string( entry.hdr, entry.bool->val ? yesW : noW ); }
/* load a dword (binary) parameter from the registry */ -static BOOL get_dword_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_dword_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { DWORD val; - if (load_entry( &entry->hdr, &val, sizeof(val) ) == sizeof(DWORD)) entry->dword.val = val; + if (load_entry( entry.hdr, &val, sizeof(val) ) == sizeof(DWORD)) entry.dword->val = val; } - *(DWORD *)ptr_param = entry->dword.val; + *(DWORD *)ptr_param = entry.dword->val; return TRUE; }
/* set a dword (binary) parameter in the registry */ -static BOOL set_dword_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_dword_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { DWORD val = PtrToUlong( ptr_param );
- if (!save_entry( &entry->hdr, &val, sizeof(val), REG_DWORD, flags )) return FALSE; - entry->dword.val = val; - entry->hdr.loaded = TRUE; + if (!save_entry( entry.hdr, &val, sizeof(val), REG_DWORD, flags )) return FALSE; + entry.dword->val = val; + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize a dword parameter */ -static BOOL init_dword_entry( union sysparam_all_entry *entry ) +static BOOL init_dword_entry( union sysparam_all_entry entry ) { - return init_entry( &entry->hdr, &entry->dword.val, sizeof(entry->dword.val), REG_DWORD ); + return init_entry( entry.hdr, &entry.dword->val, sizeof(entry.dword->val), REG_DWORD ); }
/* load an RGB parameter from the registry */ -static BOOL get_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_rgb_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buf[32];
- if (load_entry( &entry->hdr, buf, sizeof(buf) )) + if (load_entry( entry.hdr, buf, sizeof(buf) )) { DWORD r, g, b; WCHAR *end, *str = buf; @@ -2556,16 +2556,16 @@ static BOOL get_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void b = wcstoul( str, &end, 10 ); if (end == str) goto done; if (r > 255 || g > 255 || b > 255) goto done; - entry->rgb.val = RGB( r, g, b ); + entry.rgb->val = RGB( r, g, b ); } } done: - *(COLORREF *)ptr_param = entry->rgb.val; + *(COLORREF *)ptr_param = entry.rgb->val; return TRUE; }
/* set an RGB parameter in the registry */ -static BOOL set_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_rgb_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { WCHAR bufW[32]; char buf[32]; @@ -2574,15 +2574,15 @@ static BOOL set_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void
sprintf( buf, "%u %u %u", GetRValue(int_param), GetGValue(int_param), GetBValue(int_param) ); asciiz_to_unicode( bufW, buf ); - if (!save_entry_string( &entry->hdr, bufW, flags )) return FALSE; - entry->rgb.val = int_param; - entry->hdr.loaded = TRUE; - if ((brush = InterlockedExchangePointer( (void **)&entry->rgb.brush, 0 ))) + if (!save_entry_string( entry.hdr, bufW, flags )) return FALSE; + entry.rgb->val = int_param; + entry.hdr->loaded = TRUE; + if ((brush = InterlockedExchangePointer( (void **)&entry.rgb->brush, 0 ))) { make_gdi_object_system( brush, FALSE ); NtGdiDeleteObjectApp( brush ); } - if ((pen = InterlockedExchangePointer( (void **)&entry->rgb.pen, 0 ))) + if ((pen = InterlockedExchangePointer( (void **)&entry.rgb->pen, 0 ))) { make_gdi_object_system( pen, FALSE ); NtGdiDeleteObjectApp( pen ); @@ -2591,98 +2591,98 @@ static BOOL set_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void }
/* initialize an RGB parameter */ -static BOOL init_rgb_entry( union sysparam_all_entry *entry ) +static BOOL init_rgb_entry( union sysparam_all_entry entry ) { WCHAR bufW[32]; char buf[32];
- sprintf( buf, "%u %u %u", GetRValue(entry->rgb.val), GetGValue(entry->rgb.val), - GetBValue(entry->rgb.val) ); + sprintf( buf, "%u %u %u", GetRValue(entry.rgb->val), GetGValue(entry.rgb->val), + GetBValue(entry.rgb->val) ); asciiz_to_unicode( bufW, buf ); - return init_entry_string( &entry->hdr, bufW ); + return init_entry_string( entry.hdr, bufW ); }
/* get a path parameter in the registry */ -static BOOL get_path_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_path_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { WCHAR buffer[MAX_PATH];
- if (load_entry( &entry->hdr, buffer, sizeof(buffer) )) - lstrcpynW( entry->path.path, buffer, MAX_PATH ); + if (load_entry( entry.hdr, buffer, sizeof(buffer) )) + lstrcpynW( entry.path->path, buffer, MAX_PATH ); } - lstrcpynW( ptr_param, entry->path.path, int_param ); + lstrcpynW( ptr_param, entry.path->path, int_param ); return TRUE; }
/* set a path parameter in the registry */ -static BOOL set_path_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_path_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { WCHAR buffer[MAX_PATH]; BOOL ret;
lstrcpynW( buffer, ptr_param, MAX_PATH ); - ret = save_entry_string( &entry->hdr, buffer, flags ); + ret = save_entry_string( entry.hdr, buffer, flags ); if (ret) { - lstrcpyW( entry->path.path, buffer ); - entry->hdr.loaded = TRUE; + lstrcpyW( entry.path->path, buffer ); + entry.hdr->loaded = TRUE; } return ret; }
/* initialize a path parameter */ -static BOOL init_path_entry( union sysparam_all_entry *entry ) +static BOOL init_path_entry( union sysparam_all_entry entry ) { - return init_entry_string( &entry->hdr, entry->path.path ); + return init_entry_string( entry.hdr, entry.path->path ); }
/* get a binary parameter in the registry */ -static BOOL get_binary_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_binary_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { - void *buffer = malloc( entry->bin.size ); - DWORD len = load_entry( &entry->hdr, buffer, entry->bin.size ); + void *buffer = malloc( entry.bin->size ); + DWORD len = load_entry( entry.hdr, buffer, entry.bin->size );
if (len) { - memcpy( entry->bin.ptr, buffer, entry->bin.size ); - memset( (char *)entry->bin.ptr + len, 0, entry->bin.size - len ); + memcpy( entry.bin->ptr, buffer, entry.bin->size ); + memset( (char *)entry.bin->ptr + len, 0, entry.bin->size - len ); } free( buffer ); } - memcpy( ptr_param, entry->bin.ptr, min( int_param, entry->bin.size ) ); + memcpy( ptr_param, entry.bin->ptr, min( int_param, entry.bin->size ) ); return TRUE; }
/* set a binary parameter in the registry */ -static BOOL set_binary_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_binary_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { BOOL ret; - void *buffer = malloc( entry->bin.size ); + void *buffer = malloc( entry.bin->size );
- memcpy( buffer, entry->bin.ptr, entry->bin.size ); - memcpy( buffer, ptr_param, min( int_param, entry->bin.size )); - ret = save_entry( &entry->hdr, buffer, entry->bin.size, REG_BINARY, flags ); + memcpy( buffer, entry.bin->ptr, entry.bin->size ); + memcpy( buffer, ptr_param, min( int_param, entry.bin->size )); + ret = save_entry( entry.hdr, buffer, entry.bin->size, REG_BINARY, flags ); if (ret) { - memcpy( entry->bin.ptr, buffer, entry->bin.size ); - entry->hdr.loaded = TRUE; + memcpy( entry.bin->ptr, buffer, entry.bin->size ); + entry.hdr->loaded = TRUE; } free( buffer ); return ret; }
/* initialize a binary parameter */ -static BOOL init_binary_entry( union sysparam_all_entry *entry ) +static BOOL init_binary_entry( union sysparam_all_entry entry ) { - return init_entry( &entry->hdr, entry->bin.ptr, entry->bin.size, REG_BINARY ); + return init_entry( entry.hdr, entry.bin->ptr, entry.bin->size, REG_BINARY ); }
static void logfont16to32( const LOGFONT16 *font16, LPLOGFONTW font32 ) @@ -2776,50 +2776,50 @@ static void normalize_nonclientmetrics( NONCLIENTMETRICSW *pncm) }
/* load a font (binary) parameter from the registry */ -static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_font_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { LOGFONTW font;
if (!ptr_param) return FALSE;
- if (!entry->hdr.loaded) + if (!entry.hdr->loaded) { - switch (load_entry( &entry->hdr, &font, sizeof(font) )) + switch (load_entry( entry.hdr, &font, sizeof(font) )) { case sizeof(font): if (font.lfHeight > 0) /* positive height value means points ( inch/72 ) */ font.lfHeight = -muldiv( font.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 ); - entry->font.val = font; + entry.font->val = font; break; case sizeof(LOGFONT16): /* win9x-winME format */ - logfont16to32( (LOGFONT16 *)&font, &entry->font.val ); - if (entry->font.val.lfHeight > 0) - entry->font.val.lfHeight = -muldiv( entry->font.val.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 ); + logfont16to32( (LOGFONT16 *)&font, &entry.font->val ); + if (entry.font->val.lfHeight > 0) + entry.font->val.lfHeight = -muldiv( entry.font->val.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 ); break; default: WARN( "Unknown format in key %s value %s\n", - debugstr_a( parameter_key_names[entry->hdr.base_key] ), - debugstr_a( entry->hdr.regval )); + debugstr_a( parameter_key_names[entry.hdr->base_key] ), + debugstr_a( entry.hdr->regval )); /* fall through */ case 0: /* use the default GUI font */ NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(font), &font ); font.lfHeight = map_from_system_dpi( font.lfHeight ); - font.lfWeight = entry->font.weight; - entry->font.val = font; + font.lfWeight = entry.font->weight; + entry.font->val = font; break; } - get_real_fontname( &entry->font.val, entry->font.fullname ); - entry->hdr.loaded = TRUE; + get_real_fontname( &entry.font->val, entry.font->fullname ); + entry.hdr->loaded = TRUE; } - font = entry->font.val; + font = entry.font->val; font.lfHeight = map_to_dpi( font.lfHeight, dpi ); - lstrcpyW( font.lfFaceName, entry->font.fullname ); + lstrcpyW( font.lfFaceName, entry.font->fullname ); *(LOGFONTW *)ptr_param = font; return TRUE; }
/* set a font (binary) parameter in the registry */ -static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_font_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { LOGFONTW font; WCHAR *ptr; @@ -2831,66 +2831,64 @@ static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, voi memset( ptr, 0, (font.lfFaceName + LF_FACESIZE - ptr) * sizeof(WCHAR) ); if (font.lfHeight < 0) font.lfHeight = map_from_system_dpi( font.lfHeight );
- if (!save_entry( &entry->hdr, &font, sizeof(font), REG_BINARY, flags )) return FALSE; - entry->font.val = font; - get_real_fontname( &entry->font.val, entry->font.fullname ); - entry->hdr.loaded = TRUE; + if (!save_entry( entry.hdr, &font, sizeof(font), REG_BINARY, flags )) return FALSE; + entry.font->val = font; + get_real_fontname( &entry.font->val, entry.font->fullname ); + entry.hdr->loaded = TRUE; return TRUE; }
/* initialize a font (binary) parameter */ -static BOOL init_font_entry( union sysparam_all_entry *entry ) +static BOOL init_font_entry( union sysparam_all_entry entry ) { - NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val ); - entry->font.val.lfHeight = map_from_system_dpi( entry->font.val.lfHeight ); - entry->font.val.lfWeight = entry->font.weight; - get_real_fontname( &entry->font.val, entry->font.fullname ); - return init_entry( &entry->hdr, &entry->font.val, sizeof(entry->font.val), REG_BINARY ); + NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry.font->val), &entry.font->val ); + entry.font->val.lfHeight = map_from_system_dpi( entry.font->val.lfHeight ); + entry.font->val.lfWeight = entry.font->weight; + get_real_fontname( &entry.font->val, entry.font->fullname ); + return init_entry( entry.hdr, &entry.font->val, sizeof(entry.font->val), REG_BINARY ); }
/* get a user pref parameter in the registry */ -static BOOL get_userpref_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_userpref_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { - union sysparam_all_entry *parent_entry = (union sysparam_all_entry *)entry->pref.parent; + union sysparam_all_entry parent_entry = { .bin = entry.pref->parent }; BYTE prefs[8];
if (!ptr_param) return FALSE;
- if (!parent_entry->hdr.get( parent_entry, sizeof(prefs), prefs, dpi )) return FALSE; - *(BOOL *)ptr_param = (prefs[entry->pref.offset] & entry->pref.mask) != 0; + if (!parent_entry.hdr->get( parent_entry, sizeof(prefs), prefs, dpi )) return FALSE; + *(BOOL *)ptr_param = (prefs[entry.pref->offset] & entry.pref->mask) != 0; return TRUE; }
/* set a user pref parameter in the registry */ -static BOOL set_userpref_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_userpref_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { - union sysparam_all_entry *parent_entry = (union sysparam_all_entry *)entry->pref.parent; + union sysparam_all_entry parent_entry = { .bin = entry.pref->parent }; BYTE prefs[8];
- parent_entry->hdr.loaded = FALSE; /* force loading it again */ - if (!parent_entry->hdr.get( parent_entry, sizeof(prefs), prefs, get_system_dpi() )) return FALSE; + parent_entry.hdr->loaded = FALSE; /* force loading it again */ + if (!parent_entry.hdr->get( parent_entry, sizeof(prefs), prefs, get_system_dpi() )) return FALSE;
- if (PtrToUlong( ptr_param )) prefs[entry->pref.offset] |= entry->pref.mask; - else prefs[entry->pref.offset] &= ~entry->pref.mask; + if (PtrToUlong( ptr_param )) prefs[entry.pref->offset] |= entry.pref->mask; + else prefs[entry.pref->offset] &= ~entry.pref->mask;
- return parent_entry->hdr.set( parent_entry, sizeof(prefs), prefs, flags ); + return parent_entry.hdr->set( parent_entry, sizeof(prefs), prefs, flags ); }
-static BOOL get_entry_dpi( void *ptr, UINT int_param, void *ptr_param, UINT dpi ) +static BOOL get_entry_dpi( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT dpi ) { - union sysparam_all_entry *entry = ptr; - return entry->hdr.get( entry, int_param, ptr_param, dpi ); + return entry.hdr->get( entry, int_param, ptr_param, dpi ); }
-static BOOL get_entry( void *ptr, UINT int_param, void *ptr_param ) +static BOOL get_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param ) { - return get_entry_dpi( ptr, int_param, ptr_param, get_system_dpi() ); + return get_entry_dpi( entry, int_param, ptr_param, get_system_dpi() ); }
-static BOOL set_entry( void *ptr, UINT int_param, void *ptr_param, UINT flags ) +static BOOL set_entry( union sysparam_all_entry entry, UINT int_param, void *ptr_param, UINT flags ) { - union sysparam_all_entry *entry = ptr; - return entry->hdr.set( entry, int_param, ptr_param, flags ); + return entry.hdr->set( entry, int_param, ptr_param, flags ); }
#define UINT_ENTRY(name,val,base,reg) \ @@ -3049,6 +3047,13 @@ static USERPREF_ENTRY( CLIENTAREAANIMATION, 4, 0x02 ); static USERPREF_ENTRY( CLEARTYPE, 4, 0x10 ); static USERPREF_ENTRY( SPEECHRECOGNITION, 4, 0x20 );
+static inline union sysparam_all_entry get_entry_from_header( struct sysparam_entry* hdr ) +{ + union sysparam_all_entry ret = { .hdr = hdr }; + return ret; +} +#define ENTRYOF(x) get_entry_from_header(&entry_##x.hdr) + /* System parameter indexes */ enum spi_index { @@ -3097,63 +3102,63 @@ static struct sysparam_rgb_entry system_colors[] = };
/* entries that are initialized by default in the registry */ -static union sysparam_all_entry * const default_entries[] = -{ - (union sysparam_all_entry *)&entry_ACTIVEWINDOWTRACKING, - (union sysparam_all_entry *)&entry_ACTIVEWNDTRKTIMEOUT, - (union sysparam_all_entry *)&entry_BEEP, - (union sysparam_all_entry *)&entry_BLOCKSENDINPUTRESETS, - (union sysparam_all_entry *)&entry_BORDER, - (union sysparam_all_entry *)&entry_CAPTIONHEIGHT, - (union sysparam_all_entry *)&entry_CAPTIONWIDTH, - (union sysparam_all_entry *)&entry_CARETWIDTH, - (union sysparam_all_entry *)&entry_DESKWALLPAPER, - (union sysparam_all_entry *)&entry_DOUBLECLICKTIME, - (union sysparam_all_entry *)&entry_DOUBLECLKHEIGHT, - (union sysparam_all_entry *)&entry_DOUBLECLKWIDTH, - (union sysparam_all_entry *)&entry_DRAGFULLWINDOWS, - (union sysparam_all_entry *)&entry_DRAGHEIGHT, - (union sysparam_all_entry *)&entry_DRAGWIDTH, - (union sysparam_all_entry *)&entry_FOCUSBORDERHEIGHT, - (union sysparam_all_entry *)&entry_FOCUSBORDERWIDTH, - (union sysparam_all_entry *)&entry_FONTSMOOTHING, - (union sysparam_all_entry *)&entry_FONTSMOOTHINGCONTRAST, - (union sysparam_all_entry *)&entry_FONTSMOOTHINGORIENTATION, - (union sysparam_all_entry *)&entry_FONTSMOOTHINGTYPE, - (union sysparam_all_entry *)&entry_FOREGROUNDFLASHCOUNT, - (union sysparam_all_entry *)&entry_FOREGROUNDLOCKTIMEOUT, - (union sysparam_all_entry *)&entry_ICONHORIZONTALSPACING, - (union sysparam_all_entry *)&entry_ICONTITLEWRAP, - (union sysparam_all_entry *)&entry_ICONVERTICALSPACING, - (union sysparam_all_entry *)&entry_KEYBOARDDELAY, - (union sysparam_all_entry *)&entry_KEYBOARDPREF, - (union sysparam_all_entry *)&entry_KEYBOARDSPEED, - (union sysparam_all_entry *)&entry_LOWPOWERACTIVE, - (union sysparam_all_entry *)&entry_MENUHEIGHT, - (union sysparam_all_entry *)&entry_MENUSHOWDELAY, - (union sysparam_all_entry *)&entry_MENUWIDTH, - (union sysparam_all_entry *)&entry_MOUSEACCELERATION, - (union sysparam_all_entry *)&entry_MOUSEBUTTONSWAP, - (union sysparam_all_entry *)&entry_MOUSECLICKLOCKTIME, - (union sysparam_all_entry *)&entry_MOUSEHOVERHEIGHT, - (union sysparam_all_entry *)&entry_MOUSEHOVERTIME, - (union sysparam_all_entry *)&entry_MOUSEHOVERWIDTH, - (union sysparam_all_entry *)&entry_MOUSESPEED, - (union sysparam_all_entry *)&entry_MOUSETHRESHOLD1, - (union sysparam_all_entry *)&entry_MOUSETHRESHOLD2, - (union sysparam_all_entry *)&entry_PADDEDBORDERWIDTH, - (union sysparam_all_entry *)&entry_SCREENREADER, - (union sysparam_all_entry *)&entry_SCROLLHEIGHT, - (union sysparam_all_entry *)&entry_SCROLLWIDTH, - (union sysparam_all_entry *)&entry_SHOWSOUNDS, - (union sysparam_all_entry *)&entry_SMCAPTIONHEIGHT, - (union sysparam_all_entry *)&entry_SMCAPTIONWIDTH, - (union sysparam_all_entry *)&entry_SNAPTODEFBUTTON, - (union sysparam_all_entry *)&entry_USERPREFERENCESMASK, - (union sysparam_all_entry *)&entry_WHEELSCROLLCHARS, - (union sysparam_all_entry *)&entry_WHEELSCROLLLINES, - (union sysparam_all_entry *)&entry_AUDIODESC_LOCALE, - (union sysparam_all_entry *)&entry_AUDIODESC_ON, +static struct sysparam_entry *const default_entries[] = +{ + &entry_ACTIVEWINDOWTRACKING.hdr, + &entry_ACTIVEWNDTRKTIMEOUT.hdr, + &entry_BEEP.hdr, + &entry_BLOCKSENDINPUTRESETS.hdr, + &entry_BORDER.hdr, + &entry_CAPTIONHEIGHT.hdr, + &entry_CAPTIONWIDTH.hdr, + &entry_CARETWIDTH.hdr, + &entry_DESKWALLPAPER.hdr, + &entry_DOUBLECLICKTIME.hdr, + &entry_DOUBLECLKHEIGHT.hdr, + &entry_DOUBLECLKWIDTH.hdr, + &entry_DRAGFULLWINDOWS.hdr, + &entry_DRAGHEIGHT.hdr, + &entry_DRAGWIDTH.hdr, + &entry_FOCUSBORDERHEIGHT.hdr, + &entry_FOCUSBORDERWIDTH.hdr, + &entry_FONTSMOOTHING.hdr, + &entry_FONTSMOOTHINGCONTRAST.hdr, + &entry_FONTSMOOTHINGORIENTATION.hdr, + &entry_FONTSMOOTHINGTYPE.hdr, + &entry_FOREGROUNDFLASHCOUNT.hdr, + &entry_FOREGROUNDLOCKTIMEOUT.hdr, + &entry_ICONHORIZONTALSPACING.hdr, + &entry_ICONTITLEWRAP.hdr, + &entry_ICONVERTICALSPACING.hdr, + &entry_KEYBOARDDELAY.hdr, + &entry_KEYBOARDPREF.hdr, + &entry_KEYBOARDSPEED.hdr, + &entry_LOWPOWERACTIVE.hdr, + &entry_MENUHEIGHT.hdr, + &entry_MENUSHOWDELAY.hdr, + &entry_MENUWIDTH.hdr, + &entry_MOUSEACCELERATION.hdr, + &entry_MOUSEBUTTONSWAP.hdr, + &entry_MOUSECLICKLOCKTIME.hdr, + &entry_MOUSEHOVERHEIGHT.hdr, + &entry_MOUSEHOVERTIME.hdr, + &entry_MOUSEHOVERWIDTH.hdr, + &entry_MOUSESPEED.hdr, + &entry_MOUSETHRESHOLD1.hdr, + &entry_MOUSETHRESHOLD2.hdr, + &entry_PADDEDBORDERWIDTH.hdr, + &entry_SCREENREADER.hdr, + &entry_SCROLLHEIGHT.hdr, + &entry_SCROLLWIDTH.hdr, + &entry_SHOWSOUNDS.hdr, + &entry_SMCAPTIONHEIGHT.hdr, + &entry_SMCAPTIONWIDTH.hdr, + &entry_SNAPTODEFBUTTON.hdr, + &entry_USERPREFERENCESMASK.hdr, + &entry_WHEELSCROLLCHARS.hdr, + &entry_WHEELSCROLLLINES.hdr, + &entry_AUDIODESC_LOCALE.hdr, + &entry_AUDIODESC_ON.hdr, };
void sysparams_init(void) @@ -3202,7 +3207,7 @@ void sysparams_init(void)
config_key = reg_create_key( NULL, config_keyW, sizeof(config_keyW), 0, NULL );
- get_dword_entry( (union sysparam_all_entry *)&entry_LOGPIXELS, 0, &system_dpi, 0 ); + get_dword_entry( ENTRYOF( LOGPIXELS ), 0, &system_dpi, 0 ); if (!system_dpi) /* check fallback key */ { static const WCHAR log_pixelsW[] = {'L','o','g','P','i','x','e','l','s',0}; @@ -3222,13 +3227,13 @@ void sysparams_init(void) if (!system_dpi) system_dpi = USER_DEFAULT_SCREEN_DPI;
/* FIXME: what do the DpiScalingVer flags mean? */ - get_dword_entry( (union sysparam_all_entry *)&entry_DPISCALINGVER, 0, &dpi_scaling, 0 ); + get_dword_entry( ENTRYOF( DPISCALINGVER ), 0, &dpi_scaling, 0 ); if (!dpi_scaling) NtUserSetProcessDpiAwarenessContext( NTUSER_DPI_PER_MONITOR_AWARE, 0 );
if (volatile_base_key && dispos == REG_CREATED_NEW_KEY) /* first process, initialize entries */ { for (i = 0; i < ARRAY_SIZE( default_entries ); i++) - default_entries[i]->hdr.init( default_entries[i] ); + default_entries[i]->init( get_entry_from_header( default_entries[i] ) ); } }
@@ -3249,29 +3254,29 @@ BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, switch (action) { case SPI_GETICONTITLELOGFONT: - ret = get_entry_dpi( &entry_ICONTITLELOGFONT, val, ptr, dpi ); + ret = get_entry_dpi( ENTRYOF( ICONTITLELOGFONT ), val, ptr, dpi ); break; case SPI_GETNONCLIENTMETRICS: { NONCLIENTMETRICSW *ncm = ptr;
if (!ncm) break; - ret = get_entry_dpi( &entry_BORDER, 0, &ncm->iBorderWidth, dpi ) && - get_entry_dpi( &entry_SCROLLWIDTH, 0, &ncm->iScrollWidth, dpi ) && - get_entry_dpi( &entry_SCROLLHEIGHT, 0, &ncm->iScrollHeight, dpi ) && - get_entry_dpi( &entry_CAPTIONWIDTH, 0, &ncm->iCaptionWidth, dpi ) && - get_entry_dpi( &entry_CAPTIONHEIGHT, 0, &ncm->iCaptionHeight, dpi ) && - get_entry_dpi( &entry_CAPTIONLOGFONT, 0, &ncm->lfCaptionFont, dpi ) && - get_entry_dpi( &entry_SMCAPTIONWIDTH, 0, &ncm->iSmCaptionWidth, dpi ) && - get_entry_dpi( &entry_SMCAPTIONHEIGHT, 0, &ncm->iSmCaptionHeight, dpi ) && - get_entry_dpi( &entry_SMCAPTIONLOGFONT, 0, &ncm->lfSmCaptionFont, dpi ) && - get_entry_dpi( &entry_MENUWIDTH, 0, &ncm->iMenuWidth, dpi ) && - get_entry_dpi( &entry_MENUHEIGHT, 0, &ncm->iMenuHeight, dpi ) && - get_entry_dpi( &entry_MENULOGFONT, 0, &ncm->lfMenuFont, dpi ) && - get_entry_dpi( &entry_STATUSLOGFONT, 0, &ncm->lfStatusFont, dpi ) && - get_entry_dpi( &entry_MESSAGELOGFONT, 0, &ncm->lfMessageFont, dpi ); + ret = get_entry_dpi( ENTRYOF( BORDER ), 0, &ncm->iBorderWidth, dpi ) && + get_entry_dpi( ENTRYOF( SCROLLWIDTH ), 0, &ncm->iScrollWidth, dpi ) && + get_entry_dpi( ENTRYOF( SCROLLHEIGHT ), 0, &ncm->iScrollHeight, dpi ) && + get_entry_dpi( ENTRYOF( CAPTIONWIDTH ), 0, &ncm->iCaptionWidth, dpi ) && + get_entry_dpi( ENTRYOF( CAPTIONHEIGHT ), 0, &ncm->iCaptionHeight, dpi ) && + get_entry_dpi( ENTRYOF( CAPTIONLOGFONT ), 0, &ncm->lfCaptionFont, dpi ) && + get_entry_dpi( ENTRYOF( SMCAPTIONWIDTH ), 0, &ncm->iSmCaptionWidth, dpi ) && + get_entry_dpi( ENTRYOF( SMCAPTIONHEIGHT ), 0, &ncm->iSmCaptionHeight, dpi ) && + get_entry_dpi( ENTRYOF( SMCAPTIONLOGFONT ), 0, &ncm->lfSmCaptionFont, dpi ) && + get_entry_dpi( ENTRYOF( MENUWIDTH ), 0, &ncm->iMenuWidth, dpi ) && + get_entry_dpi( ENTRYOF( MENUHEIGHT ), 0, &ncm->iMenuHeight, dpi ) && + get_entry_dpi( ENTRYOF( MENULOGFONT ), 0, &ncm->lfMenuFont, dpi ) && + get_entry_dpi( ENTRYOF( STATUSLOGFONT ), 0, &ncm->lfStatusFont, dpi ) && + get_entry_dpi( ENTRYOF( MESSAGELOGFONT ), 0, &ncm->lfMessageFont, dpi ); if (ret && ncm->cbSize == sizeof(NONCLIENTMETRICSW)) - ret = get_entry_dpi( &entry_PADDEDBORDERWIDTH, 0, &ncm->iPaddedBorderWidth, dpi ); + ret = get_entry_dpi( ENTRYOF( PADDEDBORDERWIDTH ), 0, &ncm->iPaddedBorderWidth, dpi ); normalize_nonclientmetrics( ncm ); break; } @@ -3279,10 +3284,10 @@ BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, { ICONMETRICSW *im = ptr; if (im && im->cbSize == sizeof(*im)) - ret = get_entry_dpi( &entry_ICONHORIZONTALSPACING, 0, &im->iHorzSpacing, dpi ) && - get_entry_dpi( &entry_ICONVERTICALSPACING, 0, &im->iVertSpacing, dpi ) && - get_entry_dpi( &entry_ICONTITLEWRAP, 0, &im->iTitleWrap, dpi ) && - get_entry_dpi( &entry_ICONTITLELOGFONT, 0, &im->lfFont, dpi ); + ret = get_entry_dpi( ENTRYOF( ICONHORIZONTALSPACING ), 0, &im->iHorzSpacing, dpi ) && + get_entry_dpi( ENTRYOF( ICONVERTICALSPACING ), 0, &im->iVertSpacing, dpi ) && + get_entry_dpi( ENTRYOF( ICONTITLEWRAP ), 0, &im->iTitleWrap, dpi ) && + get_entry_dpi( ENTRYOF( ICONTITLELOGFONT ), 0, &im->lfFont, dpi ); break; } default: @@ -3343,117 +3348,117 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w if (!ret) switch (action) { case SPI_GETBEEP: - ret = get_entry( &entry_BEEP, val, ptr ); + ret = get_entry( ENTRYOF( BEEP ), val, ptr ); break; case SPI_SETBEEP: - ret = set_entry( &entry_BEEP, val, ptr, winini ); + ret = set_entry( ENTRYOF( BEEP ), val, ptr, winini ); break; case SPI_GETMOUSE: - ret = get_entry( &entry_MOUSETHRESHOLD1, val, (INT *)ptr ) && - get_entry( &entry_MOUSETHRESHOLD2, val, (INT *)ptr + 1 ) && - get_entry( &entry_MOUSEACCELERATION, val, (INT *)ptr + 2 ); + ret = get_entry( ENTRYOF( MOUSETHRESHOLD1 ), val, (INT *)ptr ) && + get_entry( ENTRYOF( MOUSETHRESHOLD2 ), val, (INT *)ptr + 1 ) && + get_entry( ENTRYOF( MOUSEACCELERATION ), val, (INT *)ptr + 2 ); break; case SPI_SETMOUSE: - ret = set_entry( &entry_MOUSETHRESHOLD1, ((INT *)ptr)[0], ptr, winini ) && - set_entry( &entry_MOUSETHRESHOLD2, ((INT *)ptr)[1], ptr, winini ) && - set_entry( &entry_MOUSEACCELERATION, ((INT *)ptr)[2], ptr, winini ); + ret = set_entry( ENTRYOF( MOUSETHRESHOLD1 ), ((INT *)ptr)[0], ptr, winini ) && + set_entry( ENTRYOF( MOUSETHRESHOLD2 ), ((INT *)ptr)[1], ptr, winini ) && + set_entry( ENTRYOF( MOUSEACCELERATION ), ((INT *)ptr)[2], ptr, winini ); break; case SPI_GETBORDER: - ret = get_entry( &entry_BORDER, val, ptr ); + ret = get_entry( ENTRYOF( BORDER ), val, ptr ); if (*(INT*)ptr < 1) *(INT*)ptr = 1; break; case SPI_SETBORDER: - ret = set_entry( &entry_BORDER, val, ptr, winini ); + ret = set_entry( ENTRYOF( BORDER ), val, ptr, winini ); break; case SPI_GETKEYBOARDSPEED: - ret = get_entry( &entry_KEYBOARDSPEED, val, ptr ); + ret = get_entry( ENTRYOF( KEYBOARDSPEED ), val, ptr ); break; case SPI_SETKEYBOARDSPEED: if (val > 31) val = 31; - ret = set_entry( &entry_KEYBOARDSPEED, val, ptr, winini ); + ret = set_entry( ENTRYOF( KEYBOARDSPEED ), val, ptr, winini ); break;
WINE_SPI_WARN(SPI_LANGDRIVER); /* not implemented in Windows */
case SPI_ICONHORIZONTALSPACING: if (ptr != NULL) - ret = get_entry( &entry_ICONHORIZONTALSPACING, val, ptr ); + ret = get_entry( ENTRYOF( ICONHORIZONTALSPACING ), val, ptr ); else { int min_val = map_to_dpi( 32, get_system_dpi() ); - ret = set_entry( &entry_ICONHORIZONTALSPACING, max( min_val, val ), ptr, winini ); + ret = set_entry( ENTRYOF( ICONHORIZONTALSPACING ), max( min_val, val ), ptr, winini ); } break; case SPI_GETSCREENSAVETIMEOUT: - ret = get_entry( &entry_SCREENSAVETIMEOUT, val, ptr ); + ret = get_entry( ENTRYOF( SCREENSAVETIMEOUT ), val, ptr ); break; case SPI_SETSCREENSAVETIMEOUT: - ret = set_entry( &entry_SCREENSAVETIMEOUT, val, ptr, winini ); + ret = set_entry( ENTRYOF( SCREENSAVETIMEOUT ), val, ptr, winini ); break; case SPI_GETSCREENSAVEACTIVE: - ret = get_entry( &entry_SCREENSAVEACTIVE, val, ptr ); + ret = get_entry( ENTRYOF( SCREENSAVEACTIVE ), val, ptr ); break; case SPI_SETSCREENSAVEACTIVE: - ret = set_entry( &entry_SCREENSAVEACTIVE, val, ptr, winini ); + ret = set_entry( ENTRYOF( SCREENSAVEACTIVE ), val, ptr, winini ); break; case SPI_GETGRIDGRANULARITY: - ret = get_entry( &entry_GRIDGRANULARITY, val, ptr ); + ret = get_entry( ENTRYOF( GRIDGRANULARITY ), val, ptr ); break; case SPI_SETGRIDGRANULARITY: - ret = set_entry( &entry_GRIDGRANULARITY, val, ptr, winini ); + ret = set_entry( ENTRYOF( GRIDGRANULARITY ), val, ptr, winini ); break; case SPI_SETDESKWALLPAPER: - if (!ptr || set_entry( &entry_DESKWALLPAPER, val, ptr, winini )) + if (!ptr || set_entry( ENTRYOF( DESKWALLPAPER ), val, ptr, winini )) ret = update_desktop_wallpaper(); break; case SPI_SETDESKPATTERN: - if (!ptr || set_entry( &entry_DESKPATTERN, val, ptr, winini )) + if (!ptr || set_entry( ENTRYOF( DESKPATTERN ), val, ptr, winini )) ret = update_desktop_wallpaper(); break; case SPI_GETKEYBOARDDELAY: - ret = get_entry( &entry_KEYBOARDDELAY, val, ptr ); + ret = get_entry( ENTRYOF( KEYBOARDDELAY ), val, ptr ); break; case SPI_SETKEYBOARDDELAY: - ret = set_entry( &entry_KEYBOARDDELAY, val, ptr, winini ); + ret = set_entry( ENTRYOF( KEYBOARDDELAY ), val, ptr, winini ); break; case SPI_ICONVERTICALSPACING: if (ptr != NULL) - ret = get_entry( &entry_ICONVERTICALSPACING, val, ptr ); + ret = get_entry( ENTRYOF( ICONVERTICALSPACING ), val, ptr ); else { int min_val = map_to_dpi( 32, get_system_dpi() ); - ret = set_entry( &entry_ICONVERTICALSPACING, max( min_val, val ), ptr, winini ); + ret = set_entry( ENTRYOF( ICONVERTICALSPACING ), max( min_val, val ), ptr, winini ); } break; case SPI_GETICONTITLEWRAP: - ret = get_entry( &entry_ICONTITLEWRAP, val, ptr ); + ret = get_entry( ENTRYOF( ICONTITLEWRAP ), val, ptr ); break; case SPI_SETICONTITLEWRAP: - ret = set_entry( &entry_ICONTITLEWRAP, val, ptr, winini ); + ret = set_entry( ENTRYOF( ICONTITLEWRAP ), val, ptr, winini ); break; case SPI_GETMENUDROPALIGNMENT: - ret = get_entry( &entry_MENUDROPALIGNMENT, val, ptr ); + ret = get_entry( ENTRYOF( MENUDROPALIGNMENT ), val, ptr ); break; case SPI_SETMENUDROPALIGNMENT: - ret = set_entry( &entry_MENUDROPALIGNMENT, val, ptr, winini ); + ret = set_entry( ENTRYOF( MENUDROPALIGNMENT ), val, ptr, winini ); break; case SPI_SETDOUBLECLKWIDTH: - ret = set_entry( &entry_DOUBLECLKWIDTH, val, ptr, winini ); + ret = set_entry( ENTRYOF( DOUBLECLKWIDTH ), val, ptr, winini ); break; case SPI_SETDOUBLECLKHEIGHT: - ret = set_entry( &entry_DOUBLECLKHEIGHT, val, ptr, winini ); + ret = set_entry( ENTRYOF( DOUBLECLKHEIGHT ), val, ptr, winini ); break; case SPI_GETICONTITLELOGFONT: - ret = get_entry( &entry_ICONTITLELOGFONT, val, ptr ); + ret = get_entry( ENTRYOF( ICONTITLELOGFONT ), val, ptr ); break; case SPI_SETDOUBLECLICKTIME: - ret = set_entry( &entry_DOUBLECLICKTIME, val, ptr, winini ); + ret = set_entry( ENTRYOF( DOUBLECLICKTIME ), val, ptr, winini ); break; case SPI_SETMOUSEBUTTONSWAP: - ret = set_entry( &entry_MOUSEBUTTONSWAP, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSEBUTTONSWAP ), val, ptr, winini ); break; case SPI_SETICONTITLELOGFONT: - ret = set_entry( &entry_ICONTITLELOGFONT, val, ptr, winini ); + ret = set_entry( ENTRYOF( ICONTITLELOGFONT ), val, ptr, winini ); break; case SPI_GETFASTTASKSWITCH: if (!ptr) return FALSE; @@ -3465,10 +3470,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w ret = FALSE; break; case SPI_SETDRAGFULLWINDOWS: - ret = set_entry( &entry_DRAGFULLWINDOWS, val, ptr, winini ); + ret = set_entry( ENTRYOF( DRAGFULLWINDOWS ), val, ptr, winini ); break; case SPI_GETDRAGFULLWINDOWS: - ret = get_entry( &entry_DRAGFULLWINDOWS, val, ptr ); + ret = get_entry( ENTRYOF( DRAGFULLWINDOWS ), val, ptr ); break; case SPI_GETNONCLIENTMETRICS: { @@ -3477,21 +3482,21 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w
if (!ptr) return FALSE;
- ret = get_entry( &entry_BORDER, 0, &nm->iBorderWidth ) && - get_entry( &entry_PADDEDBORDERWIDTH, 0, &padded_border ) && - get_entry( &entry_SCROLLWIDTH, 0, &nm->iScrollWidth ) && - get_entry( &entry_SCROLLHEIGHT, 0, &nm->iScrollHeight ) && - get_entry( &entry_CAPTIONWIDTH, 0, &nm->iCaptionWidth ) && - get_entry( &entry_CAPTIONHEIGHT, 0, &nm->iCaptionHeight ) && - get_entry( &entry_CAPTIONLOGFONT, 0, &nm->lfCaptionFont ) && - get_entry( &entry_SMCAPTIONWIDTH, 0, &nm->iSmCaptionWidth ) && - get_entry( &entry_SMCAPTIONHEIGHT, 0, &nm->iSmCaptionHeight ) && - get_entry( &entry_SMCAPTIONLOGFONT, 0, &nm->lfSmCaptionFont ) && - get_entry( &entry_MENUWIDTH, 0, &nm->iMenuWidth ) && - get_entry( &entry_MENUHEIGHT, 0, &nm->iMenuHeight ) && - get_entry( &entry_MENULOGFONT, 0, &nm->lfMenuFont ) && - get_entry( &entry_STATUSLOGFONT, 0, &nm->lfStatusFont ) && - get_entry( &entry_MESSAGELOGFONT, 0, &nm->lfMessageFont ); + ret = get_entry( ENTRYOF( BORDER ), 0, &nm->iBorderWidth ) && + get_entry( ENTRYOF( PADDEDBORDERWIDTH ), 0, &padded_border ) && + get_entry( ENTRYOF( SCROLLWIDTH ), 0, &nm->iScrollWidth ) && + get_entry( ENTRYOF( SCROLLHEIGHT ), 0, &nm->iScrollHeight ) && + get_entry( ENTRYOF( CAPTIONWIDTH ), 0, &nm->iCaptionWidth ) && + get_entry( ENTRYOF( CAPTIONHEIGHT ), 0, &nm->iCaptionHeight ) && + get_entry( ENTRYOF( CAPTIONLOGFONT ), 0, &nm->lfCaptionFont ) && + get_entry( ENTRYOF( SMCAPTIONWIDTH ), 0, &nm->iSmCaptionWidth ) && + get_entry( ENTRYOF( SMCAPTIONHEIGHT ), 0, &nm->iSmCaptionHeight ) && + get_entry( ENTRYOF( SMCAPTIONLOGFONT ), 0, &nm->lfSmCaptionFont ) && + get_entry( ENTRYOF( MENUWIDTH ), 0, &nm->iMenuWidth ) && + get_entry( ENTRYOF( MENUHEIGHT ), 0, &nm->iMenuHeight ) && + get_entry( ENTRYOF( MENULOGFONT ), 0, &nm->lfMenuFont ) && + get_entry( ENTRYOF( STATUSLOGFONT ), 0, &nm->lfStatusFont ) && + get_entry( ENTRYOF( MESSAGELOGFONT ), 0, &nm->lfMessageFont ); if (ret) { nm->iBorderWidth += padded_border; @@ -3508,22 +3513,22 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w if (nm && (nm->cbSize == sizeof(NONCLIENTMETRICSW) || nm->cbSize == FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth))) { - get_entry( &entry_PADDEDBORDERWIDTH, 0, &padded_border ); - - ret = set_entry( &entry_BORDER, nm->iBorderWidth - padded_border, NULL, winini ) && - set_entry( &entry_SCROLLWIDTH, nm->iScrollWidth, NULL, winini ) && - set_entry( &entry_SCROLLHEIGHT, nm->iScrollHeight, NULL, winini ) && - set_entry( &entry_CAPTIONWIDTH, nm->iCaptionWidth, NULL, winini ) && - set_entry( &entry_CAPTIONHEIGHT, nm->iCaptionHeight, NULL, winini ) && - set_entry( &entry_SMCAPTIONWIDTH, nm->iSmCaptionWidth, NULL, winini ) && - set_entry( &entry_SMCAPTIONHEIGHT, nm->iSmCaptionHeight, NULL, winini ) && - set_entry( &entry_MENUWIDTH, nm->iMenuWidth, NULL, winini ) && - set_entry( &entry_MENUHEIGHT, nm->iMenuHeight, NULL, winini ) && - set_entry( &entry_MENULOGFONT, 0, &nm->lfMenuFont, winini ) && - set_entry( &entry_CAPTIONLOGFONT, 0, &nm->lfCaptionFont, winini ) && - set_entry( &entry_SMCAPTIONLOGFONT, 0, &nm->lfSmCaptionFont, winini ) && - set_entry( &entry_STATUSLOGFONT, 0, &nm->lfStatusFont, winini ) && - set_entry( &entry_MESSAGELOGFONT, 0, &nm->lfMessageFont, winini ); + get_entry( ENTRYOF( PADDEDBORDERWIDTH ), 0, &padded_border ); + + ret = set_entry( ENTRYOF( BORDER ), nm->iBorderWidth - padded_border, NULL, winini ) && + set_entry( ENTRYOF( SCROLLWIDTH ), nm->iScrollWidth, NULL, winini ) && + set_entry( ENTRYOF( SCROLLHEIGHT ), nm->iScrollHeight, NULL, winini ) && + set_entry( ENTRYOF( CAPTIONWIDTH ), nm->iCaptionWidth, NULL, winini ) && + set_entry( ENTRYOF( CAPTIONHEIGHT ), nm->iCaptionHeight, NULL, winini ) && + set_entry( ENTRYOF( SMCAPTIONWIDTH ), nm->iSmCaptionWidth, NULL, winini ) && + set_entry( ENTRYOF( SMCAPTIONHEIGHT ), nm->iSmCaptionHeight, NULL, winini ) && + set_entry( ENTRYOF( MENUWIDTH ), nm->iMenuWidth, NULL, winini ) && + set_entry( ENTRYOF( MENUHEIGHT ), nm->iMenuHeight, NULL, winini ) && + set_entry( ENTRYOF( MENULOGFONT ), 0, &nm->lfMenuFont, winini ) && + set_entry( ENTRYOF( CAPTIONLOGFONT ), 0, &nm->lfCaptionFont, winini ) && + set_entry( ENTRYOF( SMCAPTIONLOGFONT ), 0, &nm->lfSmCaptionFont, winini ) && + set_entry( ENTRYOF( STATUSLOGFONT ), 0, &nm->lfStatusFont, winini ) && + set_entry( ENTRYOF( MESSAGELOGFONT ), 0, &nm->lfMessageFont, winini ); } break; } @@ -3531,10 +3536,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w { MINIMIZEDMETRICS *mm = ptr; if (mm && mm->cbSize == sizeof(*mm)) { - ret = get_entry( &entry_MINWIDTH, 0, &mm->iWidth ) && - get_entry( &entry_MINHORZGAP, 0, &mm->iHorzGap ) && - get_entry( &entry_MINVERTGAP, 0, &mm->iVertGap ) && - get_entry( &entry_MINARRANGE, 0, &mm->iArrange ); + ret = get_entry( ENTRYOF( MINWIDTH ), 0, &mm->iWidth ) && + get_entry( ENTRYOF( MINHORZGAP ), 0, &mm->iHorzGap ) && + get_entry( ENTRYOF( MINVERTGAP ), 0, &mm->iVertGap ) && + get_entry( ENTRYOF( MINARRANGE ), 0, &mm->iArrange ); mm->iWidth = max( 0, mm->iWidth ); mm->iHorzGap = max( 0, mm->iHorzGap ); mm->iVertGap = max( 0, mm->iVertGap ); @@ -3546,10 +3551,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w { MINIMIZEDMETRICS *mm = ptr; if (mm && mm->cbSize == sizeof(*mm)) - ret = set_entry( &entry_MINWIDTH, max( 0, mm->iWidth ), NULL, winini ) && - set_entry( &entry_MINHORZGAP, max( 0, mm->iHorzGap ), NULL, winini ) && - set_entry( &entry_MINVERTGAP, max( 0, mm->iVertGap ), NULL, winini ) && - set_entry( &entry_MINARRANGE, mm->iArrange & 0x0f, NULL, winini ); + ret = set_entry( ENTRYOF( MINWIDTH ), max( 0, mm->iWidth ), NULL, winini ) && + set_entry( ENTRYOF( MINHORZGAP ), max( 0, mm->iHorzGap ), NULL, winini ) && + set_entry( ENTRYOF( MINVERTGAP ), max( 0, mm->iVertGap ), NULL, winini ) && + set_entry( ENTRYOF( MINARRANGE ), mm->iArrange & 0x0f, NULL, winini ); break; } case SPI_GETICONMETRICS: @@ -3557,10 +3562,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w ICONMETRICSW *icon = ptr; if(icon && icon->cbSize == sizeof(*icon)) { - ret = get_entry( &entry_ICONHORIZONTALSPACING, 0, &icon->iHorzSpacing ) && - get_entry( &entry_ICONVERTICALSPACING, 0, &icon->iVertSpacing ) && - get_entry( &entry_ICONTITLEWRAP, 0, &icon->iTitleWrap ) && - get_entry( &entry_ICONTITLELOGFONT, 0, &icon->lfFont ); + ret = get_entry( ENTRYOF( ICONHORIZONTALSPACING ), 0, &icon->iHorzSpacing ) && + get_entry( ENTRYOF( ICONVERTICALSPACING ), 0, &icon->iVertSpacing ) && + get_entry( ENTRYOF( ICONTITLEWRAP ), 0, &icon->iTitleWrap ) && + get_entry( ENTRYOF( ICONTITLELOGFONT ), 0, &icon->lfFont ); } break; } @@ -3568,10 +3573,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w { ICONMETRICSW *icon = ptr; if (icon && icon->cbSize == sizeof(*icon)) - ret = set_entry( &entry_ICONVERTICALSPACING, max(32,icon->iVertSpacing), NULL, winini ) && - set_entry( &entry_ICONHORIZONTALSPACING, max(32,icon->iHorzSpacing), NULL, winini ) && - set_entry( &entry_ICONTITLEWRAP, icon->iTitleWrap, NULL, winini ) && - set_entry( &entry_ICONTITLELOGFONT, 0, &icon->lfFont, winini ); + ret = set_entry( ENTRYOF( ICONVERTICALSPACING ), max(32,icon->iVertSpacing), NULL, winini ) && + set_entry( ENTRYOF( ICONHORIZONTALSPACING ), max(32,icon->iHorzSpacing), NULL, winini ) && + set_entry( ENTRYOF( ICONTITLEWRAP ), icon->iTitleWrap, NULL, winini ) && + set_entry( ENTRYOF( ICONTITLELOGFONT ), 0, &icon->lfFont, winini ); break; } case SPI_SETWORKAREA: @@ -3666,10 +3671,10 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w WINE_SPI_FIXME(SPI_SETMOUSEKEYS);
case SPI_GETSHOWSOUNDS: - ret = get_entry( &entry_SHOWSOUNDS, val, ptr ); + ret = get_entry( ENTRYOF( SHOWSOUNDS ), val, ptr ); break; case SPI_SETSHOWSOUNDS: - ret = set_entry( &entry_SHOWSOUNDS, val, ptr, winini ); + ret = set_entry( ENTRYOF( SHOWSOUNDS ), val, ptr, winini ); break; case SPI_GETSTICKYKEYS: { @@ -3763,16 +3768,16 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w WINE_SPI_FIXME(SPI_SETHIGHCONTRAST);
case SPI_GETKEYBOARDPREF: - ret = get_entry( &entry_KEYBOARDPREF, val, ptr ); + ret = get_entry( ENTRYOF( KEYBOARDPREF ), val, ptr ); break; case SPI_SETKEYBOARDPREF: - ret = set_entry( &entry_KEYBOARDPREF, val, ptr, winini ); + ret = set_entry( ENTRYOF( KEYBOARDPREF ), val, ptr, winini ); break; case SPI_GETSCREENREADER: - ret = get_entry( &entry_SCREENREADER, val, ptr ); + ret = get_entry( ENTRYOF( SCREENREADER ), val, ptr ); break; case SPI_SETSCREENREADER: - ret = set_entry( &entry_SCREENREADER, val, ptr, winini ); + ret = set_entry( ENTRYOF( SCREENREADER ), val, ptr, winini ); break;
case SPI_GETANIMATION: @@ -3792,18 +3797,18 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w WINE_SPI_WARN(SPI_SETANIMATION);
case SPI_GETFONTSMOOTHING: - ret = get_entry( &entry_FONTSMOOTHING, val, ptr ); + ret = get_entry( ENTRYOF( FONTSMOOTHING ), val, ptr ); if (ret) *(UINT *)ptr = (*(UINT *)ptr != 0); break; case SPI_SETFONTSMOOTHING: val = val ? 2 : 0; /* Win NT4/2k/XP behavior */ - ret = set_entry( &entry_FONTSMOOTHING, val, ptr, winini ); + ret = set_entry( ENTRYOF( FONTSMOOTHING ), val, ptr, winini ); break; case SPI_SETDRAGWIDTH: - ret = set_entry( &entry_DRAGWIDTH, val, ptr, winini ); + ret = set_entry( ENTRYOF( DRAGWIDTH ), val, ptr, winini ); break; case SPI_SETDRAGHEIGHT: - ret = set_entry( &entry_DRAGHEIGHT, val, ptr, winini ); + ret = set_entry( ENTRYOF( DRAGHEIGHT ), val, ptr, winini ); break;
WINE_SPI_FIXME(SPI_SETHANDHELD); @@ -3813,16 +3818,16 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT);
case SPI_GETLOWPOWERACTIVE: - ret = get_entry( &entry_LOWPOWERACTIVE, val, ptr ); + ret = get_entry( ENTRYOF( LOWPOWERACTIVE ), val, ptr ); break; case SPI_SETLOWPOWERACTIVE: - ret = set_entry( &entry_LOWPOWERACTIVE, val, ptr, winini ); + ret = set_entry( ENTRYOF( LOWPOWERACTIVE ), val, ptr, winini ); break; case SPI_GETPOWEROFFACTIVE: - ret = get_entry( &entry_POWEROFFACTIVE, val, ptr ); + ret = get_entry( ENTRYOF( POWEROFFACTIVE ), val, ptr ); break; case SPI_SETPOWEROFFACTIVE: - ret = set_entry( &entry_POWEROFFACTIVE, val, ptr, winini ); + ret = set_entry( ENTRYOF( POWEROFFACTIVE ), val, ptr, winini ); break;
WINE_SPI_FIXME(SPI_SETCURSORS); @@ -3840,286 +3845,286 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w ret = FALSE; /* yes, this is the result value */ break; case SPI_SETMOUSETRAILS: - ret = set_entry( &entry_MOUSETRAILS, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSETRAILS ), val, ptr, winini ); break; case SPI_GETMOUSETRAILS: - ret = get_entry( &entry_MOUSETRAILS, val, ptr ); + ret = get_entry( ENTRYOF( MOUSETRAILS ), val, ptr ); break; case SPI_GETSNAPTODEFBUTTON: - ret = get_entry( &entry_SNAPTODEFBUTTON, val, ptr ); + ret = get_entry( ENTRYOF( SNAPTODEFBUTTON ), val, ptr ); break; case SPI_SETSNAPTODEFBUTTON: - ret = set_entry( &entry_SNAPTODEFBUTTON, val, ptr, winini ); + ret = set_entry( ENTRYOF( SNAPTODEFBUTTON ), val, ptr, winini ); break; case SPI_SETSCREENSAVERRUNNING: - ret = set_entry( &entry_SCREENSAVERRUNNING, val, ptr, winini ); + ret = set_entry( ENTRYOF( SCREENSAVERRUNNING ), val, ptr, winini ); break; case SPI_GETMOUSEHOVERWIDTH: - ret = get_entry( &entry_MOUSEHOVERWIDTH, val, ptr ); + ret = get_entry( ENTRYOF( MOUSEHOVERWIDTH ), val, ptr ); break; case SPI_SETMOUSEHOVERWIDTH: - ret = set_entry( &entry_MOUSEHOVERWIDTH, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSEHOVERWIDTH ), val, ptr, winini ); break; case SPI_GETMOUSEHOVERHEIGHT: - ret = get_entry( &entry_MOUSEHOVERHEIGHT, val, ptr ); + ret = get_entry( ENTRYOF( MOUSEHOVERHEIGHT ), val, ptr ); break; case SPI_SETMOUSEHOVERHEIGHT: - ret = set_entry( &entry_MOUSEHOVERHEIGHT, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSEHOVERHEIGHT ), val, ptr, winini ); break; case SPI_GETMOUSEHOVERTIME: - ret = get_entry( &entry_MOUSEHOVERTIME, val, ptr ); + ret = get_entry( ENTRYOF( MOUSEHOVERTIME ), val, ptr ); break; case SPI_SETMOUSEHOVERTIME: - ret = set_entry( &entry_MOUSEHOVERTIME, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSEHOVERTIME ), val, ptr, winini ); break; case SPI_GETWHEELSCROLLLINES: - ret = get_entry( &entry_WHEELSCROLLLINES, val, ptr ); + ret = get_entry( ENTRYOF( WHEELSCROLLLINES ), val, ptr ); break; case SPI_SETWHEELSCROLLLINES: - ret = set_entry( &entry_WHEELSCROLLLINES, val, ptr, winini ); + ret = set_entry( ENTRYOF( WHEELSCROLLLINES ), val, ptr, winini ); break; case SPI_GETMENUSHOWDELAY: - ret = get_entry( &entry_MENUSHOWDELAY, val, ptr ); + ret = get_entry( ENTRYOF( MENUSHOWDELAY ), val, ptr ); break; case SPI_SETMENUSHOWDELAY: - ret = set_entry( &entry_MENUSHOWDELAY, val, ptr, winini ); + ret = set_entry( ENTRYOF( MENUSHOWDELAY ), val, ptr, winini ); break; case SPI_GETWHEELSCROLLCHARS: - ret = get_entry( &entry_WHEELSCROLLCHARS, val, ptr ); + ret = get_entry( ENTRYOF( WHEELSCROLLCHARS ), val, ptr ); break; case SPI_SETWHEELSCROLLCHARS: - ret = set_entry( &entry_WHEELSCROLLCHARS, val, ptr, winini ); + ret = set_entry( ENTRYOF( WHEELSCROLLCHARS ), val, ptr, winini ); break;
WINE_SPI_FIXME(SPI_GETSHOWIMEUI); WINE_SPI_FIXME(SPI_SETSHOWIMEUI);
case SPI_GETMOUSESPEED: - ret = get_entry( &entry_MOUSESPEED, val, ptr ); + ret = get_entry( ENTRYOF( MOUSESPEED ), val, ptr ); break; case SPI_SETMOUSESPEED: - ret = set_entry( &entry_MOUSESPEED, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSESPEED ), val, ptr, winini ); break; case SPI_GETSCREENSAVERRUNNING: - ret = get_entry( &entry_SCREENSAVERRUNNING, val, ptr ); + ret = get_entry( ENTRYOF( SCREENSAVERRUNNING ), val, ptr ); break; case SPI_GETDESKWALLPAPER: - ret = get_entry( &entry_DESKWALLPAPER, val, ptr ); + ret = get_entry( ENTRYOF( DESKWALLPAPER ), val, ptr ); break; case SPI_GETACTIVEWINDOWTRACKING: - ret = get_entry( &entry_ACTIVEWINDOWTRACKING, val, ptr ); + ret = get_entry( ENTRYOF( ACTIVEWINDOWTRACKING ), val, ptr ); break; case SPI_SETACTIVEWINDOWTRACKING: - ret = set_entry( &entry_ACTIVEWINDOWTRACKING, val, ptr, winini ); + ret = set_entry( ENTRYOF( ACTIVEWINDOWTRACKING ), val, ptr, winini ); break; case SPI_GETMENUANIMATION: - ret = get_entry( &entry_MENUANIMATION, val, ptr ); + ret = get_entry( ENTRYOF( MENUANIMATION ), val, ptr ); break; case SPI_SETMENUANIMATION: - ret = set_entry( &entry_MENUANIMATION, val, ptr, winini ); + ret = set_entry( ENTRYOF( MENUANIMATION ), val, ptr, winini ); break; case SPI_GETCOMBOBOXANIMATION: - ret = get_entry( &entry_COMBOBOXANIMATION, val, ptr ); + ret = get_entry( ENTRYOF( COMBOBOXANIMATION ), val, ptr ); break; case SPI_SETCOMBOBOXANIMATION: - ret = set_entry( &entry_COMBOBOXANIMATION, val, ptr, winini ); + ret = set_entry( ENTRYOF( COMBOBOXANIMATION ), val, ptr, winini ); break; case SPI_GETLISTBOXSMOOTHSCROLLING: - ret = get_entry( &entry_LISTBOXSMOOTHSCROLLING, val, ptr ); + ret = get_entry( ENTRYOF( LISTBOXSMOOTHSCROLLING ), val, ptr ); break; case SPI_SETLISTBOXSMOOTHSCROLLING: - ret = set_entry( &entry_LISTBOXSMOOTHSCROLLING, val, ptr, winini ); + ret = set_entry( ENTRYOF( LISTBOXSMOOTHSCROLLING ), val, ptr, winini ); break; case SPI_GETGRADIENTCAPTIONS: - ret = get_entry( &entry_GRADIENTCAPTIONS, val, ptr ); + ret = get_entry( ENTRYOF( GRADIENTCAPTIONS ), val, ptr ); break; case SPI_SETGRADIENTCAPTIONS: - ret = set_entry( &entry_GRADIENTCAPTIONS, val, ptr, winini ); + ret = set_entry( ENTRYOF( GRADIENTCAPTIONS ), val, ptr, winini ); break; case SPI_GETKEYBOARDCUES: - ret = get_entry( &entry_KEYBOARDCUES, val, ptr ); + ret = get_entry( ENTRYOF( KEYBOARDCUES ), val, ptr ); break; case SPI_SETKEYBOARDCUES: - ret = set_entry( &entry_KEYBOARDCUES, val, ptr, winini ); + ret = set_entry( ENTRYOF( KEYBOARDCUES ), val, ptr, winini ); break; case SPI_GETACTIVEWNDTRKZORDER: - ret = get_entry( &entry_ACTIVEWNDTRKZORDER, val, ptr ); + ret = get_entry( ENTRYOF( ACTIVEWNDTRKZORDER ), val, ptr ); break; case SPI_SETACTIVEWNDTRKZORDER: - ret = set_entry( &entry_ACTIVEWNDTRKZORDER, val, ptr, winini ); + ret = set_entry( ENTRYOF( ACTIVEWNDTRKZORDER ), val, ptr, winini ); break; case SPI_GETHOTTRACKING: - ret = get_entry( &entry_HOTTRACKING, val, ptr ); + ret = get_entry( ENTRYOF( HOTTRACKING ), val, ptr ); break; case SPI_SETHOTTRACKING: - ret = set_entry( &entry_HOTTRACKING, val, ptr, winini ); + ret = set_entry( ENTRYOF( HOTTRACKING ), val, ptr, winini ); break; case SPI_GETMENUFADE: - ret = get_entry( &entry_MENUFADE, val, ptr ); + ret = get_entry( ENTRYOF( MENUFADE ), val, ptr ); break; case SPI_SETMENUFADE: - ret = set_entry( &entry_MENUFADE, val, ptr, winini ); + ret = set_entry( ENTRYOF( MENUFADE ), val, ptr, winini ); break; case SPI_GETSELECTIONFADE: - ret = get_entry( &entry_SELECTIONFADE, val, ptr ); + ret = get_entry( ENTRYOF( SELECTIONFADE ), val, ptr ); break; case SPI_SETSELECTIONFADE: - ret = set_entry( &entry_SELECTIONFADE, val, ptr, winini ); + ret = set_entry( ENTRYOF( SELECTIONFADE ), val, ptr, winini ); break; case SPI_GETTOOLTIPANIMATION: - ret = get_entry( &entry_TOOLTIPANIMATION, val, ptr ); + ret = get_entry( ENTRYOF( TOOLTIPANIMATION ), val, ptr ); break; case SPI_SETTOOLTIPANIMATION: - ret = set_entry( &entry_TOOLTIPANIMATION, val, ptr, winini ); + ret = set_entry( ENTRYOF( TOOLTIPANIMATION ), val, ptr, winini ); break; case SPI_GETTOOLTIPFADE: - ret = get_entry( &entry_TOOLTIPFADE, val, ptr ); + ret = get_entry( ENTRYOF( TOOLTIPFADE ), val, ptr ); break; case SPI_SETTOOLTIPFADE: - ret = set_entry( &entry_TOOLTIPFADE, val, ptr, winini ); + ret = set_entry( ENTRYOF( TOOLTIPFADE ), val, ptr, winini ); break; case SPI_GETCURSORSHADOW: - ret = get_entry( &entry_CURSORSHADOW, val, ptr ); + ret = get_entry( ENTRYOF( CURSORSHADOW ), val, ptr ); break; case SPI_SETCURSORSHADOW: - ret = set_entry( &entry_CURSORSHADOW, val, ptr, winini ); + ret = set_entry( ENTRYOF( CURSORSHADOW ), val, ptr, winini ); break; case SPI_GETMOUSESONAR: - ret = get_entry( &entry_MOUSESONAR, val, ptr ); + ret = get_entry( ENTRYOF( MOUSESONAR ), val, ptr ); break; case SPI_SETMOUSESONAR: - ret = set_entry( &entry_MOUSESONAR, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSESONAR ), val, ptr, winini ); break; case SPI_GETMOUSECLICKLOCK: - ret = get_entry( &entry_MOUSECLICKLOCK, val, ptr ); + ret = get_entry( ENTRYOF( MOUSECLICKLOCK ), val, ptr ); break; case SPI_SETMOUSECLICKLOCK: - ret = set_entry( &entry_MOUSECLICKLOCK, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSECLICKLOCK ), val, ptr, winini ); break; case SPI_GETMOUSEVANISH: - ret = get_entry( &entry_MOUSEVANISH, val, ptr ); + ret = get_entry( ENTRYOF( MOUSEVANISH ), val, ptr ); break; case SPI_SETMOUSEVANISH: - ret = set_entry( &entry_MOUSEVANISH, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSEVANISH ), val, ptr, winini ); break; case SPI_GETFLATMENU: - ret = get_entry( &entry_FLATMENU, val, ptr ); + ret = get_entry( ENTRYOF( FLATMENU ), val, ptr ); break; case SPI_SETFLATMENU: - ret = set_entry( &entry_FLATMENU, val, ptr, winini ); + ret = set_entry( ENTRYOF( FLATMENU ), val, ptr, winini ); break; case SPI_GETDROPSHADOW: - ret = get_entry( &entry_DROPSHADOW, val, ptr ); + ret = get_entry( ENTRYOF( DROPSHADOW ), val, ptr ); break; case SPI_SETDROPSHADOW: - ret = set_entry( &entry_DROPSHADOW, val, ptr, winini ); + ret = set_entry( ENTRYOF( DROPSHADOW ), val, ptr, winini ); break; case SPI_GETBLOCKSENDINPUTRESETS: - ret = get_entry( &entry_BLOCKSENDINPUTRESETS, val, ptr ); + ret = get_entry( ENTRYOF( BLOCKSENDINPUTRESETS ), val, ptr ); break; case SPI_SETBLOCKSENDINPUTRESETS: - ret = set_entry( &entry_BLOCKSENDINPUTRESETS, val, ptr, winini ); + ret = set_entry( ENTRYOF( BLOCKSENDINPUTRESETS ), val, ptr, winini ); break; case SPI_GETUIEFFECTS: - ret = get_entry( &entry_UIEFFECTS, val, ptr ); + ret = get_entry( ENTRYOF( UIEFFECTS ), val, ptr ); break; case SPI_SETUIEFFECTS: /* FIXME: this probably should mask other UI effect values when unset */ - ret = set_entry( &entry_UIEFFECTS, val, ptr, winini ); + ret = set_entry( ENTRYOF( UIEFFECTS ), val, ptr, winini ); break; case SPI_GETDISABLEOVERLAPPEDCONTENT: - ret = get_entry( &entry_DISABLEOVERLAPPEDCONTENT, val, ptr ); + ret = get_entry( ENTRYOF( DISABLEOVERLAPPEDCONTENT ), val, ptr ); break; case SPI_SETDISABLEOVERLAPPEDCONTENT: - ret = set_entry( &entry_DISABLEOVERLAPPEDCONTENT, val, ptr, winini ); + ret = set_entry( ENTRYOF( DISABLEOVERLAPPEDCONTENT ), val, ptr, winini ); break; case SPI_GETCLIENTAREAANIMATION: - ret = get_entry( &entry_CLIENTAREAANIMATION, val, ptr ); + ret = get_entry( ENTRYOF( CLIENTAREAANIMATION ), val, ptr ); break; case SPI_SETCLIENTAREAANIMATION: - ret = set_entry( &entry_CLIENTAREAANIMATION, val, ptr, winini ); + ret = set_entry( ENTRYOF( CLIENTAREAANIMATION ), val, ptr, winini ); break; case SPI_GETCLEARTYPE: - ret = get_entry( &entry_CLEARTYPE, val, ptr ); + ret = get_entry( ENTRYOF( CLEARTYPE ), val, ptr ); break; case SPI_SETCLEARTYPE: - ret = set_entry( &entry_CLEARTYPE, val, ptr, winini ); + ret = set_entry( ENTRYOF( CLEARTYPE ), val, ptr, winini ); break; case SPI_GETSPEECHRECOGNITION: - ret = get_entry( &entry_SPEECHRECOGNITION, val, ptr ); + ret = get_entry( ENTRYOF( SPEECHRECOGNITION ), val, ptr ); break; case SPI_SETSPEECHRECOGNITION: - ret = set_entry( &entry_SPEECHRECOGNITION, val, ptr, winini ); + ret = set_entry( ENTRYOF( SPEECHRECOGNITION ), val, ptr, winini ); break; case SPI_GETFOREGROUNDLOCKTIMEOUT: - ret = get_entry( &entry_FOREGROUNDLOCKTIMEOUT, val, ptr ); + ret = get_entry( ENTRYOF( FOREGROUNDLOCKTIMEOUT ), val, ptr ); break; case SPI_SETFOREGROUNDLOCKTIMEOUT: /* FIXME: this should check that the calling thread * is able to change the foreground window */ - ret = set_entry( &entry_FOREGROUNDLOCKTIMEOUT, val, ptr, winini ); + ret = set_entry( ENTRYOF( FOREGROUNDLOCKTIMEOUT ), val, ptr, winini ); break; case SPI_GETACTIVEWNDTRKTIMEOUT: - ret = get_entry( &entry_ACTIVEWNDTRKTIMEOUT, val, ptr ); + ret = get_entry( ENTRYOF( ACTIVEWNDTRKTIMEOUT ), val, ptr ); break; case SPI_SETACTIVEWNDTRKTIMEOUT: - ret = get_entry( &entry_ACTIVEWNDTRKTIMEOUT, val, ptr ); + ret = get_entry( ENTRYOF( ACTIVEWNDTRKTIMEOUT ), val, ptr ); break; case SPI_GETFOREGROUNDFLASHCOUNT: - ret = get_entry( &entry_FOREGROUNDFLASHCOUNT, val, ptr ); + ret = get_entry( ENTRYOF( FOREGROUNDFLASHCOUNT ), val, ptr ); break; case SPI_SETFOREGROUNDFLASHCOUNT: - ret = set_entry( &entry_FOREGROUNDFLASHCOUNT, val, ptr, winini ); + ret = set_entry( ENTRYOF( FOREGROUNDFLASHCOUNT ), val, ptr, winini ); break; case SPI_GETCARETWIDTH: - ret = get_entry( &entry_CARETWIDTH, val, ptr ); + ret = get_entry( ENTRYOF( CARETWIDTH ), val, ptr ); break; case SPI_SETCARETWIDTH: - ret = set_entry( &entry_CARETWIDTH, val, ptr, winini ); + ret = set_entry( ENTRYOF( CARETWIDTH ), val, ptr, winini ); break; case SPI_GETMOUSECLICKLOCKTIME: - ret = get_entry( &entry_MOUSECLICKLOCKTIME, val, ptr ); + ret = get_entry( ENTRYOF( MOUSECLICKLOCKTIME ), val, ptr ); break; case SPI_SETMOUSECLICKLOCKTIME: - ret = set_entry( &entry_MOUSECLICKLOCKTIME, val, ptr, winini ); + ret = set_entry( ENTRYOF( MOUSECLICKLOCKTIME ), val, ptr, winini ); break; case SPI_GETFONTSMOOTHINGTYPE: - ret = get_entry( &entry_FONTSMOOTHINGTYPE, val, ptr ); + ret = get_entry( ENTRYOF( FONTSMOOTHINGTYPE ), val, ptr ); break; case SPI_SETFONTSMOOTHINGTYPE: - ret = set_entry( &entry_FONTSMOOTHINGTYPE, val, ptr, winini ); + ret = set_entry( ENTRYOF( FONTSMOOTHINGTYPE ), val, ptr, winini ); break; case SPI_GETFONTSMOOTHINGCONTRAST: - ret = get_entry( &entry_FONTSMOOTHINGCONTRAST, val, ptr ); + ret = get_entry( ENTRYOF( FONTSMOOTHINGCONTRAST ), val, ptr ); break; case SPI_SETFONTSMOOTHINGCONTRAST: - ret = set_entry( &entry_FONTSMOOTHINGCONTRAST, val, ptr, winini ); + ret = set_entry( ENTRYOF( FONTSMOOTHINGCONTRAST ), val, ptr, winini ); break; case SPI_GETFOCUSBORDERWIDTH: - ret = get_entry( &entry_FOCUSBORDERWIDTH, val, ptr ); + ret = get_entry( ENTRYOF( FOCUSBORDERWIDTH ), val, ptr ); break; case SPI_GETFOCUSBORDERHEIGHT: - ret = get_entry( &entry_FOCUSBORDERHEIGHT, val, ptr ); + ret = get_entry( ENTRYOF( FOCUSBORDERHEIGHT ), val, ptr ); break; case SPI_SETFOCUSBORDERWIDTH: - ret = set_entry( &entry_FOCUSBORDERWIDTH, val, ptr, winini ); + ret = set_entry( ENTRYOF( FOCUSBORDERWIDTH ), val, ptr, winini ); break; case SPI_SETFOCUSBORDERHEIGHT: - ret = set_entry( &entry_FOCUSBORDERHEIGHT, val, ptr, winini ); + ret = set_entry( ENTRYOF( FOCUSBORDERHEIGHT ), val, ptr, winini ); break; case SPI_GETFONTSMOOTHINGORIENTATION: - ret = get_entry( &entry_FONTSMOOTHINGORIENTATION, val, ptr ); + ret = get_entry( ENTRYOF( FONTSMOOTHINGORIENTATION ), val, ptr ); break; case SPI_SETFONTSMOOTHINGORIENTATION: - ret = set_entry( &entry_FONTSMOOTHINGORIENTATION, val, ptr, winini ); + ret = set_entry( ENTRYOF( FONTSMOOTHINGORIENTATION ), val, ptr, winini ); break; case SPI_GETAUDIODESCRIPTION: { AUDIODESCRIPTION *audio = ptr; if (audio && audio->cbSize == sizeof(AUDIODESCRIPTION) && val == sizeof(AUDIODESCRIPTION) ) { - ret = get_entry( &entry_AUDIODESC_ON, 0, &audio->Enabled ) && - get_entry( &entry_AUDIODESC_LOCALE, 0, &audio->Locale ); + ret = get_entry( ENTRYOF( AUDIODESC_ON ), 0, &audio->Enabled ) && + get_entry( ENTRYOF( AUDIODESC_LOCALE ), 0, &audio->Locale ); } break; } @@ -4128,8 +4133,8 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w AUDIODESCRIPTION *audio = ptr; if (audio && audio->cbSize == sizeof(AUDIODESCRIPTION) && val == sizeof(AUDIODESCRIPTION) ) { - ret = set_entry( &entry_AUDIODESC_ON, 0, &audio->Enabled, winini) && - set_entry( &entry_AUDIODESC_LOCALE, 0, &audio->Locale, winini ); + ret = set_entry( ENTRYOF( AUDIODESC_ON ), 0, &audio->Enabled, winini) && + set_entry( ENTRYOF( AUDIODESC_LOCALE ), 0, &audio->Locale, winini ); } break; } @@ -4168,7 +4173,7 @@ int get_system_metrics( int index ) { case SM_CXVSCROLL: case SM_CYHSCROLL: - get_entry( &entry_SCROLLWIDTH, 0, &ret ); + get_entry( ENTRYOF( SCROLLWIDTH ), 0, &ret ); return max( ret, 8 ); case SM_CYCAPTION: ncm.cbSize = sizeof(ncm); @@ -4185,7 +4190,7 @@ int get_system_metrics( int index ) case SM_CXHTHUMB: case SM_CYVSCROLL: case SM_CXHSCROLL: - get_entry( &entry_SCROLLHEIGHT, 0, &ret ); + get_entry( ENTRYOF( SCROLLHEIGHT ), 0, &ret ); return max( ret, 8 ); case SM_CXICON: case SM_CYICON: @@ -4214,7 +4219,7 @@ int get_system_metrics( int index ) case SM_DEBUG: return 0; case SM_SWAPBUTTON: - get_entry( &entry_MOUSEBUTTONSWAP, 0, &ret ); + get_entry( ENTRYOF( MOUSEBUTTONSWAP ), 0, &ret ); return ret; case SM_RESERVED1: case SM_RESERVED2: @@ -4232,18 +4237,18 @@ int get_system_metrics( int index ) case SM_CYMIN: return get_system_metrics( SM_CYCAPTION ) + 2 * get_system_metrics( SM_CYFRAME ); case SM_CXSIZE: - get_entry( &entry_CAPTIONWIDTH, 0, &ret ); + get_entry( ENTRYOF( CAPTIONWIDTH ), 0, &ret ); return max( ret, 8 ); case SM_CYSIZE: ncm.cbSize = sizeof(ncm); NtUserSystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iCaptionHeight; case SM_CXFRAME: - get_entry( &entry_BORDER, 0, &ret ); + get_entry( ENTRYOF( BORDER ), 0, &ret ); ret = max( ret, 1 ); return get_system_metrics( SM_CXDLGFRAME ) + ret; case SM_CYFRAME: - get_entry( &entry_BORDER, 0, &ret ); + get_entry( ENTRYOF( BORDER ), 0, &ret ); ret = max( ret, 1 ); return get_system_metrics( SM_CYDLGFRAME ) + ret; case SM_CXMINTRACK: @@ -4251,10 +4256,10 @@ int get_system_metrics( int index ) case SM_CYMINTRACK: return get_system_metrics( SM_CYMIN ); case SM_CXDOUBLECLK: - get_entry( &entry_DOUBLECLKWIDTH, 0, &ret ); + get_entry( ENTRYOF( DOUBLECLKWIDTH ), 0, &ret ); return ret; case SM_CYDOUBLECLK: - get_entry( &entry_DOUBLECLKHEIGHT, 0, &ret ); + get_entry( ENTRYOF( DOUBLECLKHEIGHT ), 0, &ret ); return ret; case SM_CXICONSPACING: im.cbSize = sizeof(im); @@ -4295,14 +4300,14 @@ int get_system_metrics( int index ) NtUserSystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iSmCaptionHeight + 1; case SM_CXSMSIZE: - get_entry( &entry_SMCAPTIONWIDTH, 0, &ret ); + get_entry( ENTRYOF( SMCAPTIONWIDTH ), 0, &ret ); return ret; case SM_CYSMSIZE: ncm.cbSize = sizeof(ncm); NtUserSystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iSmCaptionHeight; case SM_CXMENUSIZE: - get_entry( &entry_MENUWIDTH, 0, &ret ); + get_entry( ENTRYOF( MENUWIDTH ), 0, &ret ); return ret; case SM_CYMENUSIZE: ncm.cbSize = sizeof(ncm); @@ -4335,13 +4340,13 @@ int get_system_metrics( int index ) case SM_CLEANBOOT: return 0; /* 0 = ok, 1 = failsafe, 2 = failsafe + network */ case SM_CXDRAG: - get_entry( &entry_DRAGWIDTH, 0, &ret ); + get_entry( ENTRYOF( DRAGWIDTH ), 0, &ret ); return ret; case SM_CYDRAG: - get_entry( &entry_DRAGHEIGHT, 0, &ret ); + get_entry( ENTRYOF( DRAGHEIGHT ), 0, &ret ); return ret; case SM_SHOWSOUNDS: - get_entry( &entry_SHOWSOUNDS, 0, &ret ); + get_entry( ENTRYOF( SHOWSOUNDS ), 0, &ret ); return ret; case SM_CXMENUCHECK: case SM_CYMENUCHECK: @@ -4412,7 +4417,7 @@ static int get_system_metrics_for_dpi( int index, unsigned int dpi ) { case SM_CXVSCROLL: case SM_CYHSCROLL: - get_entry_dpi( &entry_SCROLLWIDTH, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( SCROLLWIDTH ), 0, &ret, dpi ); return max( ret, 8 ); case SM_CYCAPTION: ncm.cbSize = sizeof(ncm); @@ -4422,7 +4427,7 @@ static int get_system_metrics_for_dpi( int index, unsigned int dpi ) case SM_CXHTHUMB: case SM_CYVSCROLL: case SM_CXHSCROLL: - get_entry_dpi( &entry_SCROLLHEIGHT, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( SCROLLHEIGHT ), 0, &ret, dpi ); return max( ret, 8 ); case SM_CXICON: case SM_CYICON: @@ -4438,18 +4443,18 @@ static int get_system_metrics_for_dpi( int index, unsigned int dpi ) NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); return ncm.iMenuHeight + 1; case SM_CXSIZE: - get_entry_dpi( &entry_CAPTIONWIDTH, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( CAPTIONWIDTH ), 0, &ret, dpi ); return max( ret, 8 ); case SM_CYSIZE: ncm.cbSize = sizeof(ncm); NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); return ncm.iCaptionHeight; case SM_CXFRAME: - get_entry_dpi( &entry_BORDER, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( BORDER ), 0, &ret, dpi ); ret = max( ret, 1 ); return get_system_metrics_for_dpi( SM_CXDLGFRAME, dpi ) + ret; case SM_CYFRAME: - get_entry_dpi( &entry_BORDER, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( BORDER ), 0, &ret, dpi ); ret = max( ret, 1 ); return get_system_metrics_for_dpi( SM_CYDLGFRAME, dpi ) + ret; case SM_CXICONSPACING: @@ -4468,14 +4473,14 @@ static int get_system_metrics_for_dpi( int index, unsigned int dpi ) NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); return ncm.iSmCaptionHeight + 1; case SM_CXSMSIZE: - get_entry_dpi( &entry_SMCAPTIONWIDTH, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( SMCAPTIONWIDTH ), 0, &ret, dpi ); return ret; case SM_CYSMSIZE: ncm.cbSize = sizeof(ncm); NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); return ncm.iSmCaptionHeight; case SM_CXMENUSIZE: - get_entry_dpi( &entry_MENUWIDTH, 0, &ret, dpi ); + get_entry_dpi( ENTRYOF( MENUWIDTH ), 0, &ret, dpi ); return ret; case SM_CYMENUSIZE: ncm.cbSize = sizeof(ncm); @@ -4502,7 +4507,7 @@ static COLORREF get_sys_color( int index ) COLORREF ret = 0;
if (index >= 0 && index < ARRAY_SIZE( system_colors )) - get_entry( &system_colors[index], 0, &ret ); + get_entry( get_entry_from_header( &system_colors[index].hdr ), 0, &ret ); return ret; }
@@ -4568,7 +4573,7 @@ UINT WINAPI NtUserGetDoubleClickTime(void) { UINT time = 0;
- get_entry( &entry_DOUBLECLICKTIME, 0, &time ); + get_entry( ENTRYOF( DOUBLECLICKTIME ), 0, &time ); if (!time) time = 500; return time; } @@ -4584,7 +4589,7 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va
for (i = 0; i < count; i++) if (colors[i] >= 0 && colors[i] <= ARRAY_SIZE( system_colors )) - set_entry( &system_colors[colors[i]], values[i], 0, 0 ); + set_entry( get_entry_from_header( &system_colors[i].hdr ), values[i], 0, 0 );
/* Send WM_SYSCOLORCHANGE message to all windows */ send_message_timeout( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0, @@ -4782,7 +4787,7 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) }
case NtUserGetDeskPattern: - return get_entry( &entry_DESKPATTERN, 256, (WCHAR *)arg ); + return get_entry( ENTRYOF( DESKPATTERN ), 256, (WCHAR *)arg );
case NtUserGetWinProcPtr: return (UINT_PTR)get_winproc_ptr( UlongToHandle(arg) );