Comctl32 infoPtr fixes
James Abbatiello
abbeyj at WPI.EDU
Wed Feb 7 07:10:19 CST 2001
Changelog:
James Abbatiello <jabbey at codeweavers.com>
Don't allow comctl32 controls to access their infoPtr before it has been
allocated or after it has been freed
--
James Abbatiello
-------------- next part --------------
Index: dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.24
diff -u -r1.24 datetime.c
--- dlls/comctl32/datetime.c 2000/11/28 22:40:56 1.24
+++ dlls/comctl32/datetime.c 2001/02/07 12:31:26
@@ -1164,6 +1164,7 @@
TRACE("\n");
COMCTL32_Free (infoPtr);
+ SetWindowLongA( hwnd, 0, 0 );
return 0;
}
@@ -1171,6 +1172,9 @@
static LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ if (!DATETIME_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
+ return DefWindowProcA( hwnd, uMsg, wParam, lParam );
+
switch (uMsg)
{
Index: dlls/comctl32/flatsb.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/flatsb.c,v
retrieving revision 1.17
diff -u -r1.17 flatsb.c
--- dlls/comctl32/flatsb.c 2001/01/26 20:43:41 1.17
+++ dlls/comctl32/flatsb.c 2001/02/07 12:31:26
@@ -195,6 +195,9 @@
static LRESULT WINAPI
FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ if (!FlatSB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
+ return DefWindowProcA( hwnd, uMsg, wParam, lParam );
+
switch (uMsg)
{
case WM_CREATE:
Index: dlls/comctl32/nativefont.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/nativefont.c,v
retrieving revision 1.12
diff -u -r1.12 nativefont.c
--- dlls/comctl32/nativefont.c 2001/01/26 20:43:41 1.12
+++ dlls/comctl32/nativefont.c 2001/02/07 12:31:27
@@ -55,6 +55,7 @@
/* free comboex info data */
COMCTL32_Free (infoPtr);
+ SetWindowLongA( hwnd, 0, 0 );
return 0;
}
@@ -64,6 +65,9 @@
static LRESULT WINAPI
NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ if (!NATIVEFONT_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
+ return DefWindowProcA( hwnd, uMsg, wParam, lParam );
+
switch (uMsg)
{
Index: dlls/comctl32/pager.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/pager.c,v
retrieving revision 1.21
diff -u -r1.21 pager.c
--- dlls/comctl32/pager.c 2001/01/26 20:43:41 1.21
+++ dlls/comctl32/pager.c 2001/02/07 12:31:27
@@ -1012,7 +1012,7 @@
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
if (!infoPtr && (uMsg != WM_CREATE))
- return DefWindowProcA (hwnd, uMsg, wParam, lParam);
+ return DefWindowProcA (hwnd, uMsg, wParam, lParam);
switch (uMsg)
{
Index: dlls/comctl32/toolbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/toolbar.c,v
retrieving revision 1.76
diff -u -r1.76 toolbar.c
--- dlls/comctl32/toolbar.c 2001/01/10 22:42:05 1.76
+++ dlls/comctl32/toolbar.c 2001/02/07 12:31:27
@@ -4266,23 +4266,11 @@
static LRESULT WINAPI
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ if (!TOOLBAR_GetInfoPtr(hwnd) && (uMsg != WM_NCCREATE))
+ return DefWindowProcA( hwnd, uMsg, wParam, lParam );
switch (uMsg)
{
- case WM_DESTROY:
- return TOOLBAR_Destroy (hwnd, wParam, lParam);
-
- case WM_NCCREATE:
- return TOOLBAR_NCCreate (hwnd, wParam, lParam);
- }
-
- if (!TOOLBAR_GetInfoPtr (hwnd))
- {
- return DefWindowProcA (hwnd, uMsg, wParam, lParam);
- }
-
- switch (uMsg)
- {
case TB_ADDBITMAP:
return TOOLBAR_AddBitmap (hwnd, wParam, lParam);
@@ -4541,6 +4529,9 @@
case WM_CREATE:
return TOOLBAR_Create (hwnd, wParam, lParam);
+ case WM_DESTROY:
+ return TOOLBAR_Destroy (hwnd, wParam, lParam);
+
case WM_ERASEBKGND:
return TOOLBAR_EraseBackground (hwnd, wParam, lParam);
@@ -4573,6 +4564,9 @@
case WM_NCCALCSIZE:
return TOOLBAR_NCCalcSize (hwnd, wParam, lParam);
+
+ case WM_NCCREATE:
+ return TOOLBAR_NCCreate (hwnd, wParam, lParam);
case WM_NCPAINT:
return TOOLBAR_NCPaint (hwnd, wParam, lParam);
More information about the wine-patches
mailing list