propsheet reentrancy fix

Matt Chapman matthewc at cse.unsw.edu.au
Tue Feb 24 00:39:32 CST 2004


This patch fixes a reentrancy issue in the property sheet
implementation by not caching a pointer that can change.

This is needed for (at least) Canon File Viewer Utility
which seems to add/remove other pages in the WM_INITDIALOG
code of one of the pages.

Matt

-------------- next part --------------
Index: propsheet.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/propsheet.c,v
retrieving revision 1.94
diff -u -r1.94 propsheet.c
--- propsheet.c	27 Jan 2004 20:11:05 -0000	1.94
+++ propsheet.c	24 Feb 2004 06:25:14 -0000
@@ -1381,7 +1381,6 @@
   DLGTEMPLATE* pTemplate;
   HWND hwndPage;
   RECT rc;
-  PropPageInfo* ppInfo = psInfo->proppage;
   PADDING_INFO padding;
   UINT pageWidth,pageHeight;
   DWORD resSize;
@@ -1494,7 +1493,7 @@
   if(temp)
       Free(temp);
 
-  ppInfo[index].hwndPage = hwndPage;
+  psInfo->proppage[index].hwndPage = hwndPage;
 
   if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
       /* FIXME: This code may no longer be correct.
@@ -2278,7 +2277,6 @@
   if (!psInfo) {
     return FALSE;
   }
-  oldPages = psInfo->proppage;
   /*
    * hpage takes precedence over index.
    */
@@ -2345,6 +2343,7 @@
   /* Remove the tab */
   SendMessageW(hwndTabControl, TCM_DELETEITEM, index, 0);
 
+  oldPages = psInfo->proppage;
   psInfo->nPages--;
   psInfo->proppage = Alloc(sizeof(PropPageInfo) * psInfo->nPages);
 


More information about the wine-patches mailing list