[Bug 19495] DialogBox() returns -1 for Invalid Window Handle, Should Be 0

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Aug 6 06:30:52 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=19495





--- Comment #26 from Andrew Nguyen <arethusa26 at gmail.com>  2009-08-06 06:30:51 ---
Created an attachment (id=22858)
 --> (http://bugs.winehq.org/attachment.cgi?id=22858)
user32/tests: Test the behavior of DialogBoxParamA with dialog procedure window
destruction.

There is an actual difference in behavior between Wine and Windows, but it's
not due to the parameters passed into DialogBoxParamA. Rather, the actual issue
is the different handling of dialogs that are destroyed by their dialog
procedure, rather than by DialogBoxParamA. While MSDN states that a dialog
procedure should call EndDialog to destroy a dialog, Robert's dialog procedure
calls DestroyWindow on the dialog window handle instead:

switch (message) {
case WM_INITDIALOG:
    PostMessage( hWnd, WM_CLOSE, 0, 0 );
    return 1;
case WM_CLOSE:
    DestroyWindow(hWnd);
    return 0;
case WM_DESTROY:
    PostQuitMessage(3);
    return 0;
default:
    break;
};

Wine's DialogBoxParamA doesn't handle this in the same manner as Windows. Line
812 of DIALOG_DoDialogBox() does:

if (!IsWindow( hwnd )) return -1;

Possibly the return value should be revised to 0. I've attached a test case
demonstrating the issue.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list