From a0e410976f64963689ef2305938a90bf5568d919 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Wed, 10 Oct 2007 21:52:22 +0000 Subject: [PATCH] sync to wine head Andrew Talbot Exclude unused headers. Mikoaj Zalewski autocomplete: Don't use sel uninitialized. svn path=/trunk/; revision=29484 --- reactos/dll/win32/shell32/autocomplete.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/shell32/autocomplete.c b/reactos/dll/win32/shell32/autocomplete.c index fe93bb34728..23c5923c030 100644 --- a/reactos/dll/win32/shell32/autocomplete.c +++ b/reactos/dll/win32/shell32/autocomplete.c @@ -39,7 +39,6 @@ #include #include #include - #define COBJMACROS #include "wine/debug.h" @@ -52,7 +51,6 @@ #include "objbase.h" #include "pidl.h" -#include "shlguid.h" #include "shlobj.h" #include "shldisp.h" #include "debughlp.h" @@ -625,7 +623,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, { IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); WCHAR *msg; - int sel = -1, len; + int sel, len; switch (uMsg) { case WM_MOUSEMOVE: @@ -633,9 +631,11 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0); break; case WM_LBUTTONDOWN: - len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL); + sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0); + if (sel < 0) + break; + len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0); msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR)); - sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0); SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg); SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));