[ros-diffs] [gadamopoulos] 53871: [shell32] - Fix auto complete init method based on Wine. Autocomplete shell tests should no longer crash now. - Brought to you by Claudiu Mihail.

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Tue Sep 27 11:58:20 UTC 2011


Author: gadamopoulos
Date: Tue Sep 27 11:58:19 2011
New Revision: 53871

URL: http://svn.reactos.org/svn/reactos?rev=53871&view=rev
Log:
[shell32]
- Fix auto complete init method based on Wine. Autocomplete shell tests should no longer crash now.
- Brought to you by Claudiu Mihail.

Modified:
    trunk/reactos/dll/win32/shell32/autocomplete.cpp
    trunk/reactos/dll/win32/shell32/autocomplete.h

Modified: trunk/reactos/dll/win32/shell32/autocomplete.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocomplete.cpp?rev=53871&r1=53870&r2=53871&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] Tue Sep 27 11:58:19 2011
@@ -45,6 +45,7 @@
 CAutoComplete::CAutoComplete()
 {
     enabled = TRUE;
+    initialized = FALSE;
     options = ACO_AUTOAPPEND;
     wpOrigEditProc = NULL;
     hwndListBox = NULL;
@@ -105,7 +106,15 @@
     if (options & ACO_RTLREADING)
         FIXME(" ACO_RTLREADING not supported\n");
 
-    hwndEdit = hwndEdit;
+    if (!hwndEdit || !punkACL)
+        return E_INVALIDARG;
+
+    if (this->initialized)
+    {
+        WARN("Autocompletion object is already initialized\n");
+        /* This->hwndEdit is set to NULL when the edit window is destroyed. */
+        return this->hwndEdit ? E_FAIL : E_UNEXPECTED;
+    }
 
     if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID *)&enumstr)))
     {
@@ -113,6 +122,8 @@
         return  E_NOINTERFACE;
     }
 
+    this->hwndEdit = hwndEdit;
+    this->initialized = TRUE;
     wpOrigEditProc = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc);
     SetWindowLongPtrW(hwndEdit, GWLP_USERDATA, (LONG_PTR)this);
 

Modified: trunk/reactos/dll/win32/shell32/autocomplete.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocomplete.h?rev=53871&r1=53870&r2=53871&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/autocomplete.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/autocomplete.h [iso-8859-1] Tue Sep 27 11:58:19 2011
@@ -29,6 +29,7 @@
 {
 private:
 	BOOL					enabled;
+	BOOL					initialized;
 	HWND					hwndEdit;
 	HWND					hwndListBox;
 	WNDPROC					wpOrigEditProc;




More information about the Ros-diffs mailing list