Commit 1848c808 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Watch out for DefMDIChildProc calls on non-MDI-child windows.

parent 8862a4ee
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "win.h" #include "win.h"
#include "class.h"
#include "heap.h" #include "heap.h"
#include "nonclient.h" #include "nonclient.h"
#include "mdi.h" #include "mdi.h"
...@@ -1645,6 +1646,14 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message, ...@@ -1645,6 +1646,14 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
ci = (MDICLIENTINFO *) clientWnd->wExtra; ci = (MDICLIENTINFO *) clientWnd->wExtra;
WIN_ReleaseWndPtr(tmpWnd); WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
return DefWindowProc16(hwnd, message, wParam, lParam);
}
switch (message) switch (message)
{ {
case WM_SETTEXT: case WM_SETTEXT:
...@@ -1837,6 +1846,14 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message, ...@@ -1837,6 +1846,14 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
ci = (MDICLIENTINFO *) clientWnd->wExtra; ci = (MDICLIENTINFO *) clientWnd->wExtra;
WIN_ReleaseWndPtr(tmpWnd); WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
return DefWindowProcA(hwnd, message, wParam, lParam);
}
switch (message) switch (message)
{ {
case WM_SETTEXT: case WM_SETTEXT:
...@@ -1907,6 +1924,14 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message, ...@@ -1907,6 +1924,14 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
ci = (MDICLIENTINFO *) clientWnd->wExtra; ci = (MDICLIENTINFO *) clientWnd->wExtra;
WIN_ReleaseWndPtr(tmpWnd); WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
return DefWindowProcW(hwnd, message, wParam, lParam);
}
switch (message) switch (message)
{ {
case WM_SETTEXT: case WM_SETTEXT:
......
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