\r
INT saveLevel; // DCLEVEL lSaveDepth\r
HDC hSelf; // DCLEVEL hdcSave Used only for MemoryDC & SaveDC.\r
- BOOL IsIC; // Use DC_Type\r
\r
HPALETTE PalIndexed;\r
\r
#include "driver.h"
/* DC flags */
-#define DC_MEMORY 0x0001 /* It is a memory DC */
#define DC_SAVED 0x0002 /* It is a saved DC */
#define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
-#define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
-
-#define GDI_DC_TYPE (1)
// GDIDEVICE flags
#define PDEV_DISPLAY 0x00000001 // Display device
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (dc->IsIC)\r
+ if (dc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(dc);\r
/* Yes, Windows really returns TRUE in this case */\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (DCDest->IsIC)\r
+ if (DCDest->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCDest);\r
/* Yes, Windows really returns TRUE in this case */\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (DCSrc->IsIC)\r
+ if (DCSrc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCSrc);\r
DC_UnlockDc(DCDest);\r
DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest);\r
return FALSE;\r
}\r
- if (DCDest->IsIC)\r
+ if (DCDest->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCDest);\r
/* Yes, Windows really returns TRUE in this case */\r
DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc);\r
return FALSE;\r
}\r
- if (DCSrc->IsIC)\r
+ if (DCSrc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCSrc);\r
DC_UnlockDc(DCDest);\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (DCDest->IsIC)\r
+ if (DCDest->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCDest);\r
/* Yes, Windows really returns TRUE in this case */\r
{\r
DCSrc = DCDest;\r
}\r
- if (DCSrc->IsIC)\r
+ if (DCSrc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCSrc);\r
if(hdcDst != hdcSrc)\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (DCDest->IsIC)\r
+ if (DCDest->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCDest);\r
/* Yes, Windows really returns TRUE in this case */\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (DCSrc->IsIC)\r
+ if (DCSrc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(DCSrc);\r
DC_UnlockDc(DCDest);\r
SetLastWin32Error(ERROR_INVALID_HANDLE);\r
return FALSE;\r
}\r
- if (dc->IsIC)\r
+ if (dc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(dc);\r
/* Yes, Windows really returns TRUE in this case */\r
}\r
Dc_Attr = dc->pDc_Attr;\r
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;\r
- if (dc->IsIC)\r
+ if (dc->DC_Type == DC_TYPE_INFO)\r
{\r
DC_UnlockDc(dc);\r
/* Yes, Windows really returns TRUE in this case */\r
SetLastWin32Error(ERROR_INVALID_HANDLE);
return Result;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
return Result;
// The RealizePalette function modifies the palette for the device associated with the specified device context. If the
// device context is a memory DC, the color table for the bitmap selected into the DC is modified. If the device
// context is a display DC, the physical palette for that device is modified.
- if(dc->w.flags == DC_MEMORY)
+ if(dc->DC_Type == DC_TYPE_MEMORY)
{
// Memory managed DC
ASSERT(sysGDI->NumColors <= 256);
PALETTE_UnlockPalette(palGDI);
// Step 3: Create the XLATEOBJ for device managed DCs
- if(dc->w.flags != DC_MEMORY)
+ if(dc->DC_Type != DC_TYPE_MEMORY)
{
// Device managed DC
palGDI->logicalToSystem = IntEngCreateXlate(sysMode, palMode, systemPalette, dc->w.hPalette);
HDC hNewDC, DisplayDC;
HRGN hVisRgn;
UNICODE_STRING DriverName;
- INT DC_Type = DC_TYPE_DIRECT;
DisplayDC = NULL;
if (hDC == NULL)
return NULL;
}
hDC = DisplayDC;
- DC_Type = DC_TYPE_MEMORY; // Null hDC == Memory DC.
}
/* Allocate a new DC based on the original DC's device */
/* Copy information from original DC to new DC */
NewDC->hSelf = hNewDC;
- NewDC->IsIC = FALSE;
- NewDC->DC_Type = DC_Type;
NewDC->PDev = OrigDC->PDev;
}
return NULL;
}
- NewDC->w.flags = DC_MEMORY;
+ NewDC->DC_Type = DC_TYPE_MEMORY; // Always!
NewDC->w.hBitmap = hBitmap;
NewDC->w.hFirstBitmap = hBitmap;
NewDC->pPDev = OrigDC->pPDev;
if(!nDc_Attr) nDc_Attr = &NewDC->Dc_Attr;
NewDC->DC_Type = DC_TYPE_DIRECT;
- NewDC->IsIC = CreateAsIC;
NewDC->PDev = PrimarySurface.hPDev;
if(pUMdhpdev) pUMdhpdev = NewDC->PDev; // set DHPDEV for device.
NtGdiSelectBrush (DCHandle, STOCK_WHITE_BRUSH);
NtGdiSelectFont (DCHandle, STOCK_SYSTEM_FONT);
DC_LockDC (DCHandle); NtGdiSelectXxx does not recognize stock objects yet */
- if (DCToDelete->w.flags & DC_MEMORY)
+ if (DCToDelete->DC_Type == DC_TYPE_MEMORY)
{
NtGdiDeleteObject (DCToDelete->w.hFirstBitmap);
}
nDc_Attr->szlViewportExt = Dc_Attr->szlViewportExt;
newdc->saveLevel = 0;
- newdc->IsIC = dc->IsIC;
+ newdc->DC_Type = dc->DC_Type;
#if 0
PATH_InitGdiPath( &newdc->w.path );
Dc_Attr->szlViewportExt = sDc_Attr->szlViewportExt;
dc->PalIndexed = dcs->PalIndexed;
- if (!(dc->w.flags & DC_MEMORY))
+ if (dc->DC_Type != DC_TYPE_MEMORY)
{
dc->w.bitsPerPixel = dcs->w.bitsPerPixel;
}
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
/* must be memory dc to select bitmap */
- if (!(pDC->w.flags & DC_MEMORY))
+ if (pDC->DC_Type != DC_TYPE_MEMORY)
{
DC_UnlockDc(pDC);
return NULL;
UINT Index;
if (!(dc = DC_LockDc(hDC))) return 0;
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
return 0;
UINT Index;
if (!(dc = DC_LockDc(hDC))) return 0;
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
return 0;
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
}
- if (Dc->IsIC)
+ if (Dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(Dc);
return 0;
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
}
- if (pDC->IsIC)
+ if (pDC->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(pDC);
return 0;
/* Get handle for the palette in DC. */
Dc = DC_LockDc(hDC);
if (Dc == NULL) return 0;
- if (Dc->IsIC)
+ if (Dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(Dc);
return 0;
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
DPRINT1("NtGdiRoundRect() - hDC is invalid\n");
SetLastWin32Error(ERROR_INVALID_HANDLE);
}
- else if (dc->IsIC)
+ else if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return -1;
}
- if ( pDC->IsIC )
+ if ( pDC->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(pDC);
return 0;
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- if (dc->IsIC)
+ if (dc->DC_Type == DC_TYPE_INFO)
{
DC_UnlockDc(dc);
/* Yes, Windows really returns TRUE in this case */