http://bugs.winehq.org/show_bug.cgi?id=20341
--- Comment #2 from Ričardas Barkauskas miegalius@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.