Author: jimtabor
Date: Mon Aug 24 08:10:52 2009
New Revision: 42903
URL:
http://svn.reactos.org/svn/reactos?rev=42903&view=rev
Log:
- Patch by Dmitry Timoshkov : user32: Return 0 from DefDlgProc and dialog loop for invalid
dialog handles. Need to update user32 wine tests.
Modified:
trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Mon Aug 24 08:10:52 2009
@@ -142,6 +142,8 @@
*
* Get the DIALOGINFO structure of a window, allocating it if needed
* and 'create' is TRUE.
+*
+* ReactOS
*/
DIALOGINFO * DIALOG_get_info( HWND hWnd, BOOL create )
{
@@ -151,6 +153,11 @@
if(!dlgInfo && create)
{
pWindow = ValidateHwnd( hWnd );
+ if (!pWindow)
+ {
+ SetLastError( ERROR_INVALID_WINDOW_HANDLE );
+ return NULL;
+ }
if (pWindow && pWindow->cbwndExtra >= DLGWINDOWEXTRA &&
hWnd != GetDesktopWindow())
{
@@ -551,7 +558,7 @@
if (!GetMessageW( &msg, 0, 0, 0 )) break;
}
- if (!IsWindow( hwnd )) return -1;
+ if (!IsWindow( hwnd )) return 0;
if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd,
&msg))
{
TranslateMessage( &msg );
@@ -1585,7 +1592,7 @@
BOOL result = FALSE;
/* Perform DIALOGINFO initialization if not done */
- if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return -1;
+ if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
@@ -1645,7 +1652,7 @@
BOOL result = FALSE;
/* Perform DIALOGINFO initialization if not done */
- if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return -1;
+ if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );