propsheet fix

Andreas Mohr amohr at codeweavers.com
Sun Feb 11 18:43:25 CST 2001


Hi all,

Banshee Screamer, an alarm program with source (!) does this:
CProgramPage::CProgramPage()
{
        _PageStruct.dwFlags = PSH_NOAPPLYNOW | PSP_USETITLE;
        _PageStruct.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_PROGRAM);
        _PageStruct.pszTitle = language.get("program_options");
}

This is highly illegal, as it mixes PSH_xxx and PSP_xxx.
PSH_APPLYNOW translates to PSP_USECALLBACK.
pfnCallback is NULL, Wine calls it -> BOOM !

This is for pages. The same check could be applied to the header,
but as I'm not sure whether it also checks there I don't apply it.

Check PROPSHEETPAGEA.pfnCallback for NULL pointer if PSP_USECALLBACK
is given.

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at wine.codeweavers.com:/home/cvs/wine
Index: dlls/comctl32/propsheet.c
===================================================================
RCS file: /home/cvs/wine/wine/dlls/comctl32/propsheet.c,v
retrieving revision 1.49
diff -u -r1.49 propsheet.c
--- dlls/comctl32/propsheet.c	2001/01/10 22:42:58	1.49
+++ dlls/comctl32/propsheet.c	2001/02/12 06:17:42
@@ -199,7 +199,7 @@
    * Process property page flags.
    */
   dwFlags = lppsp->dwFlags;
-  psInfo->proppage[index].useCallback = dwFlags & PSP_USECALLBACK;
+  psInfo->proppage[index].useCallback = (dwFlags & PSP_USECALLBACK) && (lppsp->pfnCallback);
   psInfo->proppage[index].hasHelp = dwFlags & PSP_HASHELP;
   psInfo->proppage[index].hasIcon = dwFlags & (PSP_USEHICON | PSP_USEICONID);
 


More information about the wine-patches mailing list