Author: jimtabor
Date: Sun Feb 20 22:20:51 2011
New Revision: 50847
URL:
http://svn.reactos.org/svn/reactos?rev=50847&view=rev
Log:
[Win32k|User32]
- WM_MDICREATE originates from user space so treat it as it should, fixes bug 5903.
Modified:
trunk/reactos/dll/win32/user32/windows/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Sun Feb 20 22:20:51
2011
@@ -296,26 +296,6 @@
}
break;
- case WM_MDICREATE:
- {
- MDICREATESTRUCTW *mCs = (MDICREATESTRUCTW *) KMMsg->lParam;
- PCHAR Class;
- mCs->szTitle = (LPCWSTR) ((PCHAR) mCs + (DWORD_PTR) mCs->szTitle);
- Class = (PCHAR) mCs + (DWORD_PTR) mCs->szClass;
- if (L'A' == *((WCHAR *) Class))
- {
- Class += sizeof(WCHAR);
- mCs->szClass = (LPCWSTR)(DWORD_PTR) (*((ATOM *) Class));
- }
- else
- {
- ASSERT(L'S' == *((WCHAR *) Class));
- Class += sizeof(WCHAR);
- mCs->szClass = (LPCWSTR) Class;
- }
- }
- break;
-
case WM_DDE_ACK:
{
PKMDDELPARAM DdeLparam = (PKMDDELPARAM) KMMsg->lParam;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sun Feb 20
22:20:51 2011
@@ -139,7 +139,6 @@
{ WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ },
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
- { WM_MDICREATE, MMS_SIZE_SPECIAL, MMS_FLAG_READWRITE },
};
static PMSGMEMORY FASTCALL
@@ -165,7 +164,6 @@
MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
{
CREATESTRUCTW *Cs;
- MDICREATESTRUCTW *mCs;
PUNICODE_STRING WindowName;
PUNICODE_STRING ClassName;
UINT Size = 0;
@@ -204,21 +202,6 @@
}
break;
- case WM_MDICREATE:
- mCs = (MDICREATESTRUCTW *)lParam;
- WindowName = (PUNICODE_STRING) mCs->szTitle;
- ClassName = (PUNICODE_STRING) mCs->szClass;
- Size = sizeof(MDICREATESTRUCTW) + WindowName->Length + sizeof(WCHAR);
- if (IS_ATOM(ClassName->Buffer))
- {
- Size += sizeof(WCHAR) + sizeof(ATOM);
- }
- else
- {
- Size += sizeof(WCHAR) + ClassName->Length + sizeof(WCHAR);
- }
- break;
-
case WM_NCCALCSIZE:
Size = wParam ? sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS) :
sizeof(RECT);
break;
@@ -254,7 +237,6 @@
NCCALCSIZE_PARAMS *PackedNcCalcsize;
CREATESTRUCTW *UnpackedCs;
CREATESTRUCTW *PackedCs;
- MDICREATESTRUCTW *UnpackedmCs, *PackedmCs;
PLARGE_STRING WindowName;
PUNICODE_STRING ClassName;
POOL_TYPE PoolType;
@@ -333,53 +315,6 @@
ASSERT(CsData == (PCHAR) PackedCs + Size);
*lParamPacked = (LPARAM) PackedCs;
}
- else if (WM_MDICREATE == Msg)
- {
- UnpackedmCs = (MDICREATESTRUCTW *) lParam;
- WindowName = (PLARGE_STRING) UnpackedmCs->szTitle;
- ClassName = (PUNICODE_STRING) UnpackedmCs->szClass;
- Size = sizeof(MDICREATESTRUCTW) + WindowName->Length + sizeof(WCHAR);
- if (IS_ATOM(ClassName->Buffer))
- {
- Size += sizeof(WCHAR) + sizeof(ATOM);
- }
- else
- {
- Size += sizeof(WCHAR) + ClassName->Length + sizeof(WCHAR);
- }
- PackedmCs = ExAllocatePoolWithTag(PoolType, Size, TAG_MSG);
- if (NULL == PackedmCs)
- {
- DPRINT1("Not enough memory to pack lParam\n");
- return STATUS_NO_MEMORY;
- }
- RtlCopyMemory(PackedmCs, UnpackedmCs, sizeof(MDICREATESTRUCTW));
- CsData = (PCHAR) (PackedmCs + 1);
- PackedmCs->szTitle = (LPCWSTR) (CsData - (PCHAR) PackedmCs);
- RtlCopyMemory(CsData, WindowName->Buffer, WindowName->Length);
- CsData += WindowName->Length;
- *((WCHAR *) CsData) = L'\0';
- CsData += sizeof(WCHAR);
- PackedmCs->szClass = (LPCWSTR) (CsData - (PCHAR) PackedmCs);
- if (IS_ATOM(ClassName->Buffer))
- {
- *((WCHAR *) CsData) = L'A';
- CsData += sizeof(WCHAR);
- *((ATOM *) CsData) = (ATOM)(DWORD_PTR) ClassName->Buffer;
- CsData += sizeof(ATOM);
- }
- else
- {
- *((WCHAR *) CsData) = L'S';
- CsData += sizeof(WCHAR);
- RtlCopyMemory(CsData, ClassName->Buffer, ClassName->Length);
- CsData += ClassName->Length;
- *((WCHAR *) CsData) = L'\0';
- CsData += sizeof(WCHAR);
- }
- ASSERT(CsData == (PCHAR) PackedmCs + Size);
- *lParamPacked = (LPARAM) PackedmCs;
- }
else if (PoolType == NonPagedPool)
{
PMSGMEMORY MsgMemoryEntry;
@@ -428,11 +363,6 @@
{
ExFreePool((PVOID) lParamPacked);
- return STATUS_SUCCESS;
- }
- else if (WM_MDICREATE == Msg)
- {
- ExFreePool((PVOID) lParamPacked);
return STATUS_SUCCESS;
}
else if (NonPagedPoolUsed)