[ros-diffs] [greatlrd] 33267: NtUserEnumDisplaySettings remove two MmCopyFromCaller, never use MmCopyFromCaller for it make debuging pain in the ass
greatlrd at svn.reactos.org
greatlrd at svn.reactos.org
Sun May 4 15:23:20 CEST 2008
Author: greatlrd
Date: Sun May 4 08:23:19 2008
New Revision: 33267
URL: http://svn.reactos.org/svn/reactos?rev=33267&view=rev
Log:
NtUserEnumDisplaySettings
remove two MmCopyFromCaller, never use MmCopyFromCaller for it make debuging pain in the ass
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/windc.c?rev=33267&r1=33266&r2=33267&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Sun May 4 08:23:19 2008
@@ -914,18 +914,21 @@
USHORT Size = 0, ExtraSize = 0;
/* Copy the devmode */
- Status = MmCopyFromCaller(&Size, &lpDevMode->dmSize, sizeof (Size));
- if (!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return FALSE;
- }
- Status = MmCopyFromCaller(&ExtraSize, &lpDevMode->dmDriverExtra, sizeof (ExtraSize));
- if (!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return FALSE;
- }
+ _SEH_TRY
+ {
+ ProbeForRead(&lpDevMode->dmSize, sizeof(DEVMODEW), 1);
+ Size = lpDevMode->dmSize;
+ ExtraSize = lpDevMode->dmDriverExtra;
+ }
+ _SEH_HANDLE
+ {
+ DPRINT1("FIXME ? : Out of range of DEVMODEW size \n");
+ SetLastNtError(_SEH_GetExceptionCode());
+ _SEH_YIELD(return FALSE);
+ }
+ _SEH_END;
+
+
pSafeDevMode = ExAllocatePool(PagedPool, Size + ExtraSize);
if (pSafeDevMode == NULL)
{
More information about the Ros-diffs
mailing list