Commit 841ef6eb authored by James Abbatiello's avatar James Abbatiello Committed by Alexandre Julliard

Don't allow comctl32 controls to access their infoPtr before it has

been allocated or after it has been freed.
parent 14150c1a
...@@ -1164,6 +1164,7 @@ DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1164,6 +1164,7 @@ DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("\n"); TRACE("\n");
COMCTL32_Free (infoPtr); COMCTL32_Free (infoPtr);
SetWindowLongA( hwnd, 0, 0 );
return 0; return 0;
} }
...@@ -1171,6 +1172,9 @@ DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1171,6 +1172,9 @@ DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI static LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 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) switch (uMsg)
{ {
......
...@@ -195,6 +195,9 @@ FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -195,6 +195,9 @@ FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI static LRESULT WINAPI
FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 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) switch (uMsg)
{ {
case WM_CREATE: case WM_CREATE:
......
...@@ -55,6 +55,7 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -55,6 +55,7 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* free comboex info data */ /* free comboex info data */
COMCTL32_Free (infoPtr); COMCTL32_Free (infoPtr);
SetWindowLongA( hwnd, 0, 0 );
return 0; return 0;
} }
...@@ -64,6 +65,9 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -64,6 +65,9 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI static LRESULT WINAPI
NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 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) switch (uMsg)
{ {
......
...@@ -1099,7 +1099,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1099,7 +1099,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
if (!infoPtr && (uMsg != WM_CREATE)) if (!infoPtr && (uMsg != WM_CREATE))
return DefWindowProcA (hwnd, uMsg, wParam, lParam); return DefWindowProcA (hwnd, uMsg, wParam, lParam);
switch (uMsg) switch (uMsg)
{ {
......
...@@ -4266,20 +4266,8 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle) ...@@ -4266,20 +4266,8 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle)
static LRESULT WINAPI static LRESULT WINAPI
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
if (!TOOLBAR_GetInfoPtr(hwnd) && (uMsg != WM_NCCREATE))
switch (uMsg) return DefWindowProcA( hwnd, uMsg, wParam, lParam );
{
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) switch (uMsg)
{ {
...@@ -4541,6 +4529,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -4541,6 +4529,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_CREATE: case WM_CREATE:
return TOOLBAR_Create (hwnd, wParam, lParam); return TOOLBAR_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return TOOLBAR_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND: case WM_ERASEBKGND:
return TOOLBAR_EraseBackground (hwnd, wParam, lParam); return TOOLBAR_EraseBackground (hwnd, wParam, lParam);
...@@ -4574,6 +4565,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -4574,6 +4565,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCCALCSIZE: case WM_NCCALCSIZE:
return TOOLBAR_NCCalcSize (hwnd, wParam, lParam); return TOOLBAR_NCCalcSize (hwnd, wParam, lParam);
case WM_NCCREATE:
return TOOLBAR_NCCreate (hwnd, wParam, lParam);
case WM_NCPAINT: case WM_NCPAINT:
return TOOLBAR_NCPaint (hwnd, wParam, lParam); return TOOLBAR_NCPaint (hwnd, wParam, lParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment