Author: cwittich
Date: Sat Sep 8 16:13:49 2007
New Revision: 28943
URL:
http://svn.reactos.org/svn/reactos?rev=28943&view=rev
Log:
handle CachedMode->dmSize
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sat Sep 8 16:13:49 2007
@@ -2998,9 +2998,9 @@
ASSERT(CachedMode != NULL);
- RtlCopyMemory(pDevMode, CachedMode, pDevMode->dmSize);
+ RtlCopyMemory(pDevMode, CachedMode, min(pDevMode->dmSize, CachedMode->dmSize));
RtlZeroMemory(pDevMode + pDevMode->dmSize, pDevMode->dmDriverExtra);
- RtlCopyMemory(pDevMode + pDevMode->dmSize, CachedMode + CachedMode->dmSize,
min(pDevMode->dmDriverExtra, CachedMode->dmDriverExtra));
+ RtlCopyMemory(pDevMode + min(pDevMode->dmSize, CachedMode->dmSize), CachedMode +
CachedMode->dmSize, min(pDevMode->dmDriverExtra, CachedMode->dmDriverExtra));
return TRUE;
}