diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index b0fcf14d8d4..d53e35fa9d4 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -28,7 +28,10 @@ #define NDEBUG #include +// --------------------------------------------------------- File Statics + static GDIDEVICE PrimarySurface; +static PGDIDEVICE pPrimarySurface = NULL; static KEVENT VideoDriverNeedsPreparation; static KEVENT VideoDriverPrepared; static PDC defaultDCstate = NULL; @@ -44,8 +47,6 @@ InitDcImpl(VOID) /* FIXME: DCs should probably be thread safe */ -// --------------------------------------------------------- File Statics - // ----------------------------------------------------- Public Functions BOOL STDCALL @@ -362,6 +363,8 @@ IntPrepareDriver() RtlZeroMemory(&PrimarySurface, sizeof(PrimarySurface)); + if (!pPrimarySurface) pPrimarySurface = ExAllocatePoolWithTag(PagedPool, sizeof(GDIDEVICE), TAG_GDIPDEV); + PrimarySurface.VideoFileObject = DRIVER_FindMPDriver(DisplayNumber); /* Open the miniport driver */