[Bug 20341] pcsx2 beta: crashes when exiting LilyPad configuraiton dialog

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Oct 13 08:30:51 CDT 2009


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





--- Comment #2 from Ričardas Barkauskas <miegalius at gmail.com>  2009-10-13 08:30:50 ---
Created an attachment (id=24074)
 --> (http://bugs.winehq.org/attachment.cgi?id=24074)
Fix for propsheet_indextohwnd when window handle is invalid

Lilypad configuration dialog source has such code

...DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM lParam) {
        int index = (hWnd == PropSheet_IndexToHwnd(hWndProp, 1));..

where hWndProp is global and is set using this:

int CALLBACK PropSheetProc(HWND hWnd, UINT msg, LPARAM lParam) {
        if (hWnd) hWndProp = hWnd;
        return 0;
}

As such it tries to get property sheet handle of another window on every
message received. When window is beeing destroyed it still tries to get the
handle. On Vista/XP it continues returning same handle, but at some point
returns completely different value. The value changes between test runs, but
seems to stay the same for same testrun when using modified propsheet tests
(although I'm still tempted to say it's random).
While trying to find a way not to put test into message procedure found out 
that CallWindowProc can be used to call dialog procedure directly (MSDN). This
patch uses this to pass invalid handle to dialog procedure while also fixing it
so as to avoid the crash.

-- 
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