https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d01a103d71a21411fe217704abf7081cbfb9f86

commit 3d01a103d71a21411fe217704abf7081cbfb9f86
Author:     Hervé Poussineau <[email protected]>
AuthorDate: Thu Nov 10 22:06:11 2022 +0100
Commit:     Hervé Poussineau <[email protected]>
CommitDate: Tue Nov 15 23:16:10 2022 +0100

    [WIN32SS:ENG] Zero memory when allocating GRAPHICS_DEVICE structures
---
 win32ss/gdi/eng/device.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c
index a4bbb2c7254..8a0d686d2ea 100644
--- a/win32ss/gdi/eng/device.c
+++ b/win32ss/gdi/eng/device.c
@@ -465,9 +465,9 @@ EngpRegisterGraphicsDevice(
     TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName);
 
     /* Allocate a GRAPHICS_DEVICE structure */
-    pGraphicsDevice = ExAllocatePoolWithTag(PagedPool,
-                                            sizeof(GRAPHICS_DEVICE),
-                                            GDITAG_GDEVICE);
+    pGraphicsDevice = ExAllocatePoolZero(PagedPool,
+                                         sizeof(GRAPHICS_DEVICE),
+                                         GDITAG_GDEVICE);
     if (!pGraphicsDevice)
     {
         ERR("ExAllocatePoolWithTag failed\n");
@@ -563,15 +563,6 @@ EngpRegisterGraphicsDevice(
                   pustrDescription->Length);
     pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 
0;
 
-    /* Initialize the pdevmodeInfo list */
-    pGraphicsDevice->pdevmodeInfo = NULL;
-
-    // FIXME: initialize state flags
-    pGraphicsDevice->StateFlags = 0;
-
-    /* Create the mode list */
-    pGraphicsDevice->pDevModeList = NULL;
-
     /* Lock loader */
     EngAcquireSemaphore(ghsemGraphicsDeviceList);
 

Reply via email to