- Create defaultDCstate when the first dc is created not when the first dce is created
- Fix build

svn path=/trunk/; revision=55746
This commit is contained in:
Giannis Adamopoulos 2012-02-20 10:58:55 +00:00
parent 6e4d714573
commit 000dac9eb6
3 changed files with 19 additions and 19 deletions

View file

@ -41,6 +41,7 @@ typedef struct tagDCE
#define DCX_NORECOMPUTE 0x00100000
#define DCX_INDESTROY 0x00400000
INIT_FUNCTION NTSTATUS NTAPI InitDCEImpl(VOID);
PDCE FASTCALL DceAllocDCE(PWND Window, DCE_TYPE Type);
HWND FASTCALL IntWindowFromDC(HDC hDc);
PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force);

View file

@ -24,34 +24,26 @@ static INT DCECount = 0; // Count of DCE in system.
/* FUNCTIONS *****************************************************************/
INIT_FUNCTION
NTSTATUS
NTAPI
InitDCEImpl(VOID)
{
InitializeListHead(&LEDce);
return STATUS_SUCCESS;
}
//
// This should be moved to dc.c or dcutil.c.
//
HDC FASTCALL
DceCreateDisplayDC(VOID)
{
HDC hDC;
UNICODE_STRING DriverName;
RtlInitUnicodeString(&DriverName, L"DISPLAY");
hDC = IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
UNICODE_STRING DriverName = RTL_CONSTANT_STRING(L"DISPLAY");
co_IntGraphicsCheck(TRUE);
//
// If NULL, first time through! Build the default window dc!
//
if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG!
{ // This is a cheesy way to do this.
PDC dc = DC_LockDc ( hDC );
ASSERT(dc);
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
RtlZeroMemory(defaultDCstate, sizeof(DC));
defaultDCstate->pdcattr = &defaultDCstate->dcattr;
DC_vCopyState(dc, defaultDCstate, TRUE);
DC_UnlockDc( dc );
InitializeListHead(&LEDce);
}
return hDC;
return IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
}
static

View file

@ -347,6 +347,13 @@ DC_vInitDc(
pdc->dcattr.iCS_CP = 0;
pdc->pSurfInfo = NULL;
if (defaultDCstate == NULL)
{
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
RtlZeroMemory(defaultDCstate, sizeof(DC));
defaultDCstate->pdcattr = &defaultDCstate->dcattr;
DC_vCopyState(pdc, defaultDCstate, TRUE);
}
}
BOOL