mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 10:52:52 +00:00
[Win32k|User32]
- WM_MDICREATE originates from user space so treat it as it should, fixes bug 5903. svn path=/trunk/; revision=50847
This commit is contained in:
parent
1e0e0dd6be
commit
6e2693dad2
|
@ -296,26 +296,6 @@ MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case WM_DDE_ACK:
|
||||||
{
|
{
|
||||||
PKMDDELPARAM DdeLparam = (PKMDDELPARAM) KMMsg->lParam;
|
PKMDDELPARAM DdeLparam = (PKMDDELPARAM) KMMsg->lParam;
|
||||||
|
|
|
@ -139,7 +139,6 @@ static MSGMEMORY MsgMemory[] =
|
||||||
{ WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
{ WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
||||||
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
|
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
|
||||||
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
||||||
{ WM_MDICREATE, MMS_SIZE_SPECIAL, MMS_FLAG_READWRITE },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static PMSGMEMORY FASTCALL
|
static PMSGMEMORY FASTCALL
|
||||||
|
@ -165,7 +164,6 @@ static UINT FASTCALL
|
||||||
MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
|
MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
CREATESTRUCTW *Cs;
|
CREATESTRUCTW *Cs;
|
||||||
MDICREATESTRUCTW *mCs;
|
|
||||||
PUNICODE_STRING WindowName;
|
PUNICODE_STRING WindowName;
|
||||||
PUNICODE_STRING ClassName;
|
PUNICODE_STRING ClassName;
|
||||||
UINT Size = 0;
|
UINT Size = 0;
|
||||||
|
@ -204,21 +202,6 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case WM_NCCALCSIZE:
|
||||||
Size = wParam ? sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS) : sizeof(RECT);
|
Size = wParam ? sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS) : sizeof(RECT);
|
||||||
break;
|
break;
|
||||||
|
@ -254,7 +237,6 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non
|
||||||
NCCALCSIZE_PARAMS *PackedNcCalcsize;
|
NCCALCSIZE_PARAMS *PackedNcCalcsize;
|
||||||
CREATESTRUCTW *UnpackedCs;
|
CREATESTRUCTW *UnpackedCs;
|
||||||
CREATESTRUCTW *PackedCs;
|
CREATESTRUCTW *PackedCs;
|
||||||
MDICREATESTRUCTW *UnpackedmCs, *PackedmCs;
|
|
||||||
PLARGE_STRING WindowName;
|
PLARGE_STRING WindowName;
|
||||||
PUNICODE_STRING ClassName;
|
PUNICODE_STRING ClassName;
|
||||||
POOL_TYPE PoolType;
|
POOL_TYPE PoolType;
|
||||||
|
@ -333,53 +315,6 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non
|
||||||
ASSERT(CsData == (PCHAR) PackedCs + Size);
|
ASSERT(CsData == (PCHAR) PackedCs + Size);
|
||||||
*lParamPacked = (LPARAM) PackedCs;
|
*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)
|
else if (PoolType == NonPagedPool)
|
||||||
{
|
{
|
||||||
PMSGMEMORY MsgMemoryEntry;
|
PMSGMEMORY MsgMemoryEntry;
|
||||||
|
@ -430,11 +365,6 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL No
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
else if (WM_MDICREATE == Msg)
|
|
||||||
{
|
|
||||||
ExFreePool((PVOID) lParamPacked);
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
else if (NonPagedPoolUsed)
|
else if (NonPagedPoolUsed)
|
||||||
{
|
{
|
||||||
PMSGMEMORY MsgMemoryEntry;
|
PMSGMEMORY MsgMemoryEntry;
|
||||||
|
|
Loading…
Reference in a new issue