[Win32k|User32]
authorJames Tabor <james.tabor@reactos.org>
Sun, 20 Feb 2011 22:20:51 +0000 (22:20 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sun, 20 Feb 2011 22:20:51 +0000 (22:20 +0000)
- WM_MDICREATE originates from user space so treat it as it should, fixes bug 5903.

svn path=/trunk/; revision=50847

reactos/dll/win32/user32/windows/message.c
reactos/subsystems/win32/win32k/ntuser/message.c

index df82ac3..f00e667 100644 (file)
@@ -296,26 +296,6 @@ MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
         }
         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;
index 5c66991..c5761cc 100644 (file)
@@ -139,7 +139,6 @@ static MSGMEMORY MsgMemory[] =
     { 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 @@ static UINT FASTCALL
 MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
 {
     CREATESTRUCTW *Cs;
-    MDICREATESTRUCTW *mCs;
     PUNICODE_STRING WindowName;
     PUNICODE_STRING ClassName;
     UINT Size = 0;
@@ -204,21 +202,6 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
                 }
                 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 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non
     NCCALCSIZE_PARAMS *PackedNcCalcsize;
     CREATESTRUCTW *UnpackedCs;
     CREATESTRUCTW *PackedCs;
-    MDICREATESTRUCTW *UnpackedmCs, *PackedmCs;
     PLARGE_STRING WindowName;
     PUNICODE_STRING ClassName;
     POOL_TYPE PoolType;
@@ -333,53 +315,6 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non
         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;
@@ -430,11 +365,6 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL No
 
         return STATUS_SUCCESS;
     }
-    else if (WM_MDICREATE == Msg)
-    {
-        ExFreePool((PVOID) lParamPacked);
-        return STATUS_SUCCESS;
-    }
     else if (NonPagedPoolUsed)
     {
         PMSGMEMORY MsgMemoryEntry;