- [NtDDraw]
authorJames Tabor <james.tabor@reactos.org>
Sun, 27 Sep 2009 03:12:02 +0000 (03:12 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sun, 27 Sep 2009 03:12:02 +0000 (03:12 +0000)
- Export global DD context size. Create a container for both PDev and EDDG structures. When allocating PDev and add the DD context size if not zero.

svn path=/trunk/; revision=43176

reactos/subsystems/win32/win32k/include/pdevobj.h
reactos/subsystems/win32/win32k/ntddraw/ddraw.c
reactos/subsystems/win32/win32k/objects/device.c

index a474a55..01b7c53 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __WIN32K_PDEVOBJ_H
 #define __WIN32K_PDEVOBJ_H
 
+#include <drivers/directx/directxint.h>
+
 /* PDEVOBJ flags */
 #define PDEV_DISPLAY             0x00000001 /* Display device */
 #define PDEV_HARDWARE_POINTER    0x00000002 /* Supports hardware cursor */
@@ -134,4 +136,13 @@ typedef struct _PDEVOBJ
     struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
 } PDEVOBJ, *PPDEVOBJ;
 
+/* PDEV and EDDX extra data container.*/
+typedef struct _PDEVEDD
+{
+    PDEVOBJ pdevobj;
+    EDD_DIRECTDRAW_GLOBAL EDDgpl;
+} PDEVEDD, *PPDEVEDD;
+
+extern ULONG gdwDirectDrawContext;
+
 #endif /* !__WIN32K_PDEVOBJ_H */
index d79a339..3abbd18 100644 (file)
@@ -22,7 +22,7 @@ extern EDD_DIRECTDRAW_GLOBAL edd_DdirectDraw_Global;
 
 DRVFN gpDxFuncs[DXG_INDEX_DxDdIoctl];
 HANDLE ghDxGraphics = NULL;
-ULONG gdwDirectDrawContext;
+ULONG gdwDirectDrawContext = 0;
 
 #define DXDBG 1
 
index 53fea84..6dfe195 100644 (file)
@@ -229,7 +229,7 @@ IntPrepareDriver(VOID)
 
         RtlZeroMemory(&PrimarySurface, sizeof(PrimarySurface));
 
-//      if (!pPrimarySurface) pPrimarySurface = ExAllocatePoolWithTag(PagedPool, sizeof(PDEVOBJ), TAG_GDIPDEV);
+//      if (!pPrimarySurface) pPrimarySurface = ExAllocatePoolWithTag(PagedPool, gdwDirectDrawContext + sizeof(PDEVOBJ), TAG_GDIPDEV);
 
         PrimarySurface.VideoFileObject = DRIVER_FindMPDriver(DisplayNumber);