Author: janderwald Date: Thu Oct 11 01:52:22 2007 New Revision: 29484
URL: http://svn.reactos.org/svn/reactos?rev=29484&view=rev Log: sync to wine head Andrew Talbot Andrew.Talbot@talbotville.com Exclude unused headers. Mikoaj Zalewski mikolaj@zalewski.pl autocomplete: Don't use sel uninitialized.
Modified: trunk/reactos/dll/win32/shell32/autocomplete.c
Modified: trunk/reactos/dll/win32/shell32/autocomplete.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocompl... ============================================================================== --- trunk/reactos/dll/win32/shell32/autocomplete.c (original) +++ trunk/reactos/dll/win32/shell32/autocomplete.c Thu Oct 11 01:52:22 2007 @@ -39,7 +39,6 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> - #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 @@ { 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 @@ 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));