NtUserEnumDisplaySettings
authorMagnus Olsen <magnus@greatlord.com>
Sun, 4 May 2008 13:23:19 +0000 (13:23 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 4 May 2008 13:23:19 +0000 (13:23 +0000)
remove two MmCopyFromCaller, never use MmCopyFromCaller for it make debuging pain in the ass

svn path=/trunk/; revision=33267

reactos/subsystems/win32/win32k/ntuser/windc.c

index 9dc8ab4..6ed9ed9 100644 (file)
@@ -914,18 +914,21 @@ NtUserEnumDisplaySettings(
    USHORT Size = 0, ExtraSize = 0;
 
    /* Copy the devmode */
-   Status = MmCopyFromCaller(&Size, &lpDevMode->dmSize, sizeof (Size));
-   if (!NT_SUCCESS(Status))
+   _SEH_TRY
    {
-      SetLastNtError(Status);
-      return FALSE;
+        ProbeForRead(&lpDevMode->dmSize, sizeof(DEVMODEW), 1);
+        Size = lpDevMode->dmSize;
+        ExtraSize = lpDevMode->dmDriverExtra;
    }
-   Status = MmCopyFromCaller(&ExtraSize, &lpDevMode->dmDriverExtra, sizeof (ExtraSize));
-   if (!NT_SUCCESS(Status))
+   _SEH_HANDLE
    {
-      SetLastNtError(Status);
-      return FALSE;
+       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)
    {