Jacek Caban : user32: Initialize cbSize of NONCLIENTMETRICSW struct in GetSystemMetrics.
Alexandre Julliard
julliard at winehq.org
Thu Jan 3 13:31:13 CST 2013
Module: wine
Branch: master
Commit: ded419707ac75182259cd58d5c5e3904532d933d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ded419707ac75182259cd58d5c5e3904532d933d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Jan 3 11:45:02 2013 +0100
user32: Initialize cbSize of NONCLIENTMETRICSW struct in GetSystemMetrics.
---
dlls/user32/sysparams.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 5029902..175753c 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -2419,6 +2419,7 @@ INT WINAPI GetSystemMetrics( INT index )
case SM_RESERVED4:
return 0;
case SM_CXMIN:
+ ncm.cbSize = sizeof(ncm);
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
get_text_metr_size( get_display_dc(), &ncm.lfCaptionFont, NULL, &ret );
return 3 * ncm.iCaptionWidth + ncm.iCaptionHeight + 4 * ret + 2 * GetSystemMetrics(SM_CXFRAME) + 4;
@@ -2428,6 +2429,7 @@ INT WINAPI GetSystemMetrics( INT index )
get_entry( &entry_CAPTIONWIDTH, 0, &ret );
return max( 8, ret );
case SM_CYSIZE:
+ ncm.cbSize = sizeof(ncm);
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
return ncm.iCaptionHeight;
case SM_CXFRAME:
@@ -2486,12 +2488,14 @@ INT WINAPI GetSystemMetrics( INT index )
get_entry( &entry_SMCAPTIONWIDTH, 0, &ret );
return ret;
case SM_CYSMSIZE:
+ ncm.cbSize = sizeof(ncm);
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
return ncm.iSmCaptionHeight;
case SM_CXMENUSIZE:
get_entry( &entry_MENUWIDTH, 0, &ret );
return ret;
case SM_CYMENUSIZE:
+ ncm.cbSize = sizeof(ncm);
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
return ncm.iMenuHeight;
case SM_ARRANGE:
@@ -2529,6 +2533,7 @@ INT WINAPI GetSystemMetrics( INT index )
case SM_CYMENUCHECK:
{
TEXTMETRICW tm;
+ ncm.cbSize = sizeof(ncm);
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
get_text_metr_size( get_display_dc(), &ncm.lfMenuFont, &tm, NULL);
return tm.tmHeight <= 0 ? 13 : ((tm.tmHeight + tm.tmExternalLeading + 1) / 2) * 2 - 1;
More information about the wine-cvs
mailing list