Author: jimtabor
Date: Mon Nov 4 04:26:40 2013
New Revision: 60865
URL:
http://svn.reactos.org/svn/reactos?rev=60865&view=rev
Log:
- Fix condition when lParam is null and not allow it to go into exception.
Modified:
trunk/reactos/win32ss/user/ntuser/message.c
Modified: trunk/reactos/win32ss/user/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] Mon Nov 4 04:26:40 2013
@@ -174,7 +174,14 @@
}
else if (MMS_SIZE_LPARAMSZ == MsgMemoryEntry->Size)
{
- Size = (UINT) ((wcslen((PWSTR) lParam) + 1) * sizeof(WCHAR));
+ // WM_SETTEXT and WM_SETTINGCHANGE can be null!
+ if (!lParam)
+ {
+ TRACE("lParam is NULL!\n");
+ Size = 0;
+ }
+ else
+ Size = (UINT) ((wcslen((PWSTR) lParam) + 1) * sizeof(WCHAR));
}
else if (MMS_SIZE_SPECIAL == MsgMemoryEntry->Size)
{
@@ -436,6 +443,7 @@
/* Copy data if required */
if (0 != (MsgMemoryEntry->Flags & MMS_FLAG_READ))
{
+ TRACE("Copy Message %d from usermode buffer\n",
KernelModeMsg->message);
Status = MmCopyFromCaller(KernelMem, (PVOID) UserModeMsg->lParam, Size);
if (! NT_SUCCESS(Status))
{