[PATCH] user32: remove duplicated call of GetSystemMenu (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Feb 18 08:33:56 CST 2012


CID 5567

Ciao, Marcus
---
 dlls/user32/nonclient.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 5ca0a8d..389093d 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -1470,13 +1470,14 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
 {
     MSG msg;
     INT hittest = wParam;
-    HMENU hSysMenu = GetSystemMenu(hwnd, FALSE);
 
     switch (hittest)
     {
     case HTCAPTION:
     case HTSYSMENU:
-        hSysMenu = GetSystemMenu(hwnd, FALSE);
+    {
+        HMENU hSysMenu = GetSystemMenu(hwnd, FALSE);
+
         if (!hSysMenu) break;
 
         SetCapture( hwnd );
@@ -1495,6 +1496,7 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
             SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, msg.lParam );
         break;
     }
+    }
     return 0;
 }
 
-- 
1.7.3.4




More information about the wine-patches mailing list