ReactOS 0.4.15-dev-8393-g61b7fb9
dc.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for dc.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

HDC FASTCALL IntCreateDICW (LPCWSTR lpwszDriver, LPCWSTR lpwszDevice, LPCWSTR lpwszOutput, PDEVMODEW lpInitData, ULONG iType)
 
HDC WINAPI CreateCompatibleDC (_In_ HDC hdc)
 
HDC WINAPI CreateDCA (LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, CONST DEVMODEA *lpdvmInit)
 
HDC WINAPI CreateDCW (LPCWSTR lpwszDriver, LPCWSTR lpwszDevice, LPCWSTR lpwszOutput, CONST DEVMODEW *lpInitData)
 
HDC WINAPI CreateICW (LPCWSTR lpszDriver, LPCWSTR lpszDevice, LPCWSTR lpszOutput, CONST DEVMODEW *lpdvmInit)
 
HDC WINAPI CreateICA (LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, CONST DEVMODEA *lpdvmInit)
 
BOOL WINAPI DeleteDC (HDC hdc)
 
INT WINAPI SaveDC (IN HDC hdc)
 
BOOL WINAPI RestoreDC (IN HDC hdc, IN INT iLevel)
 
BOOL WINAPI CancelDC (HDC hDC)
 
INT WINAPI GetArcDirection (_In_ HDC hdc)
 
INT WINAPI SetArcDirection (_In_ HDC hdc, _In_ INT nDirection)
 
BOOL WINAPI GdiReleaseDC (HDC hdc)
 
BOOL WINAPI GdiCleanCacheDC (HDC hdc)
 
HDC WINAPI GdiConvertAndCheckDC (HDC hdc)
 
HGDIOBJ WINAPI GetCurrentObject (_In_ HDC hdc, _In_ UINT uObjectType)
 
int WINAPI EnumObjects (HDC hdc, int nObjectType, GOBJENUMPROC lpObjectFunc, LPARAM lParam)
 
int WINAPI GetDeviceCaps (_In_ HDC hdc, _In_ int nIndex)
 
DWORD WINAPI GetRelAbs (_In_ HDC hdc, _In_ DWORD dwIgnore)
 
INT WINAPI SetRelAbs (HDC hdc, INT Mode)
 
DWORD WINAPI GetAndSetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
 
DWORD WINAPI GetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
 
BOOL WINAPI GetAspectRatioFilterEx (HDC hdc, LPSIZE lpAspectRatio)
 
UINT WINAPI GetBoundsRect (HDC hdc, LPRECT lprcBounds, UINT flags)
 
UINT WINAPI SetBoundsRect (HDC hdc, CONST RECT *prc, UINT flags)
 
int WINAPI GetClipBox (HDC hdc, LPRECT lprc)
 
COLORREF WINAPI GetDCBrushColor (_In_ HDC hdc)
 
COLORREF WINAPI GetDCPenColor (_In_ HDC hdc)
 
COLORREF WINAPI SetDCBrushColor (_In_ HDC hdc, _In_ COLORREF crColor)
 
COLORREF WINAPI SetDCPenColor (_In_ HDC hdc, _In_ COLORREF crColor)
 
COLORREF WINAPI GetBkColor (_In_ HDC hdc)
 
COLORREF WINAPI SetBkColor (_In_ HDC hdc, _In_ COLORREF crColor)
 
int WINAPI GetBkMode (HDC hdc)
 
int WINAPI SetBkMode (_In_ HDC hdc, _In_ int iBkMode)
 
int WINAPI GetROP2 (_In_ HDC hdc)
 
int WINAPI SetROP2 (_In_ HDC hdc, _In_ int rop2)
 
int WINAPI GetPolyFillMode (HDC hdc)
 
int WINAPI SetPolyFillMode (_In_ HDC hdc, _In_ int iPolyFillMode)
 
int WINAPI GetGraphicsMode (HDC hdc)
 
int WINAPI SetGraphicsMode (_In_ HDC hdc, _In_ int iMode)
 
HDC WINAPI ResetDCW (_In_ HDC hdc, _In_ CONST DEVMODEW *lpInitData)
 
HDC WINAPI ResetDCA (_In_ HDC hdc, _In_ CONST DEVMODEA *lpInitData)
 
HPALETTE WINAPI NtUserSelectPalette (HDC hDC, HPALETTE hpal, BOOL ForceBackground)
 
HPALETTE WINAPI SelectPalette (HDC hdc, HPALETTE hpal, BOOL bForceBackground)
 
int WINAPI GetStretchBltMode (HDC hdc)
 
int WINAPI SetStretchBltMode (_In_ HDC hdc, _In_ int iStretchMode)
 
HFONT WINAPI GetHFONT (HDC hdc)
 
HBITMAP WINAPI GdiSelectBitmap (_In_ HDC hdc, _In_ HBITMAP hbmp)
 
HBRUSH WINAPI GdiSelectBrush (_In_ HDC hdc, _In_ HBRUSH hbr)
 
HPEN WINAPI GdiSelectPen (_In_ HDC hdc, _In_ HPEN hpen)
 
HFONT WINAPI GdiSelectFont (_In_ HDC hdc, _In_ HFONT hfont)
 
HGDIOBJ WINAPI SelectObject (_In_ HDC hdc, _In_ HGDIOBJ hobj)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file dc.c.

Function Documentation

◆ CancelDC()

BOOL WINAPI CancelDC ( HDC  hDC)

Definition at line 328 of file dc.c.

329{
330 PDC_ATTR pDc_Attr;
331
334 {
335 PLDC pLDC = GdiGetLDC(hDC);
336 if ( !pLDC )
337 {
339 return FALSE;
340 }
341 /* If a document has started set it to die. */
342 if (pLDC->Flags & LDC_INIT_DOCUMENT) pLDC->Flags |= LDC_KILL_DOCUMENT;
343
344 return NtGdiCancelDC(hDC);
345 }
346
348 {
349 pDc_Attr->ulDirty_ &= ~DC_PLAYMETAFILE;
350 return TRUE;
351 }
352
353 return FALSE;
354}
static HDC hDC
Definition: 3dtext.c:33
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define GDI_OBJECT_TYPE_DC
Definition: gdi.h:46
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define GDI_OBJECT_TYPE_METADC
Definition: gdi.h:57
PVOID GdiGetHandleUserData(_In_ HGDIOBJ hobj)
Definition: gditools.c:68
__kernel_entry W32KAPI BOOL APIENTRY NtGdiCancelDC(_In_ HDC hdc)
#define LDC_INIT_DOCUMENT
Definition: ntgdihdl.h:151
#define LDC_KILL_DOCUMENT
Definition: ntgdihdl.h:158
Definition: ntgdihdl.h:263
ULONG Flags
Definition: ntgdihdl.h:265

◆ CreateCompatibleDC()

HDC WINAPI CreateCompatibleDC ( _In_ HDC  hdc)

Definition at line 97 of file dc.c.

99{
100 HDC hdcNew;
101// PDC_ATTR pdcattr;
102
104#if 0
105 if ( hdc && hdcNew)
106 {
108 {
109 if (pdcattr->pvLIcm) IcmCompatibleDC(hdcNew, hdc, pdcattr);
110 }
111 }
112#endif
113
114 return hdcNew;
115}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)

◆ CreateDCA()

HDC WINAPI CreateDCA ( LPCSTR  lpszDriver,
LPCSTR  lpszDevice,
LPCSTR  lpszOutput,
CONST DEVMODEA lpdvmInit 
)

Definition at line 122 of file dc.c.

127{
128 ANSI_STRING DriverA, DeviceA, OutputA;
129 UNICODE_STRING DriverU, DeviceU, OutputU;
130 LPDEVMODEW dvmInitW = NULL;
131 HDC hdc;
132
133 /*
134 * If needed, convert to Unicode
135 * any string parameter.
136 */
137
138 if (lpszDriver != NULL)
139 {
140 RtlInitAnsiString(&DriverA, (LPSTR)lpszDriver);
141 RtlAnsiStringToUnicodeString(&DriverU, &DriverA, TRUE);
142 }
143 else
144 {
145 DriverU.Buffer = NULL;
146 }
147
148 if (lpszDevice != NULL)
149 {
150 RtlInitAnsiString(&DeviceA, (LPSTR)lpszDevice);
151 RtlAnsiStringToUnicodeString(&DeviceU, &DeviceA, TRUE);
152 }
153 else
154 {
155 DeviceU.Buffer = NULL;
156 }
157
158 if (lpszOutput != NULL)
159 {
160 RtlInitAnsiString(&OutputA, (LPSTR)lpszOutput);
161 RtlAnsiStringToUnicodeString(&OutputU, &OutputA, TRUE);
162 }
163 else
164 {
165 OutputU.Buffer = NULL;
166 }
167
168 if (lpdvmInit != NULL)
169 dvmInitW = GdiConvertToDevmodeW((LPDEVMODEA)lpdvmInit);
170
171 hdc = IntCreateDICW(DriverU.Buffer,
172 DeviceU.Buffer,
173 OutputU.Buffer,
174 lpdvmInit ? dvmInitW : NULL,
175 0);
176 HEAP_free(dvmInitW);
177
178 /* Free Unicode parameters. */
179 RtlFreeUnicodeString(&DriverU);
180 RtlFreeUnicodeString(&DeviceU);
181 RtlFreeUnicodeString(&OutputU);
182
183 /* Return the DC handle. */
184 return hdc;
185}
#define NULL
Definition: types.h:112
VOID HEAP_free(LPVOID memory)
Definition: heap.c:63
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
HDC FASTCALL IntCreateDICW(LPCWSTR lpwszDriver, LPCWSTR lpwszDevice, LPCWSTR lpwszOutput, PDEVMODEW lpInitData, ULONG iType)
Definition: dc.c:8
DEVMODEW *WINAPI GdiConvertToDevmodeW(const DEVMODEA *)
Definition: misc.c:969
char * LPSTR
Definition: xmlstorage.h:182

◆ CreateDCW()

HDC WINAPI CreateDCW ( LPCWSTR  lpwszDriver,
LPCWSTR  lpwszDevice,
LPCWSTR  lpwszOutput,
CONST DEVMODEW lpInitData 
)

Definition at line 193 of file dc.c.

198{
199 return IntCreateDICW(lpwszDriver,
200 lpwszDevice,
201 lpwszOutput,
202 (PDEVMODEW)lpInitData,
203 0);
204}

◆ CreateICA()

HDC WINAPI CreateICA ( LPCSTR  lpszDriver,
LPCSTR  lpszDevice,
LPCSTR  lpszOutput,
CONST DEVMODEA lpdvmInit 
)

Definition at line 231 of file dc.c.

236{
238 LPWSTR lpszDriverW, lpszDeviceW, lpszOutputW;
239 LPDEVMODEW dvmInitW = NULL;
240 HDC hdc = 0;
241
242 Status = HEAP_strdupA2W(&lpszDriverW, lpszDriver);
243 if (!NT_SUCCESS(Status))
245 else
246 {
247 Status = HEAP_strdupA2W(&lpszDeviceW, lpszDevice);
248 if (!NT_SUCCESS(Status))
250 else
251 {
252 Status = HEAP_strdupA2W(&lpszOutputW, lpszOutput);
253 if (!NT_SUCCESS(Status))
255 else
256 {
257 if (lpdvmInit)
258 dvmInitW = GdiConvertToDevmodeW((LPDEVMODEA)lpdvmInit);
259
260 hdc = IntCreateDICW(lpszDriverW,
261 lpszDeviceW,
262 lpszOutputW,
263 lpdvmInit ? dvmInitW : NULL,
264 1 );
265 HEAP_free(dvmInitW);
266 HEAP_free(lpszOutputW);
267 }
268 HEAP_free(lpszDeviceW);
269 }
270 HEAP_free(lpszDriverW);
271 }
272
273 return hdc;
274}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS HEAP_strdupA2W(LPWSTR *ppszW, LPCSTR lpszA)
Definition: heap.c:43
Status
Definition: gdiplustypes.h:25
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ CreateICW()

HDC WINAPI CreateICW ( LPCWSTR  lpszDriver,
LPCWSTR  lpszDevice,
LPCWSTR  lpszOutput,
CONST DEVMODEW lpdvmInit 
)

Definition at line 212 of file dc.c.

217{
218 return IntCreateDICW(lpszDriver,
219 lpszDevice,
220 lpszOutput,
221 (PDEVMODEW)lpdvmInit,
222 1);
223}

◆ DeleteDC()

BOOL WINAPI DeleteDC ( HDC  hdc)

Definition at line 282 of file dc.c.

283{
285
286 if (hType != GDILoObjType_LO_DC_TYPE)
287 {
289 }
290
291 //if ( ghICM || pdcattr->pvLIcm )
292 // IcmDeleteLocalDC( hdc, pdcattr, NULL );
293
295}
BOOL WINAPI METADC_RosGlueDeleteDC(_In_ HDC hdc)
Definition: rosglue.c:392
@ GDILoObjType_LO_DC_TYPE
Definition: gdi_private.h:34
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
uint32_t ULONG
Definition: typedefs.h:59

◆ EnumObjects()

int WINAPI EnumObjects ( HDC  hdc,
int  nObjectType,
GOBJENUMPROC  lpObjectFunc,
LPARAM  lParam 
)

Definition at line 489 of file dc.c.

493{
494 ULONG ObjectsCount;
495 ULONG Size;
496 PVOID Buffer = NULL;
497 DWORD_PTR EndOfBuffer;
498 int Result = 0;
499
500 switch (nObjectType)
501 {
502 case OBJ_BRUSH:
503 Size = sizeof(LOGBRUSH);
504 break;
505
506 case OBJ_PEN:
507 Size = sizeof(LOGPEN);
508 break;
509
510 default:
512 return 0;
513 }
514
515 ObjectsCount = NtGdiEnumObjects(hdc, nObjectType, 0, NULL);
516 if (!ObjectsCount) return 0;
517
518 Buffer = HeapAlloc(GetProcessHeap(), 0, ObjectsCount * Size);
519 if (!Buffer)
520 {
522 return 0;
523 }
524
525 if (!NtGdiEnumObjects(hdc, nObjectType, ObjectsCount * Size, Buffer))
526 {
528 return 0;
529 }
530
531 EndOfBuffer = (DWORD_PTR)Buffer + (ObjectsCount * Size);
532 while ((DWORD_PTR)Buffer < EndOfBuffer)
533 {
534 Result = lpObjectFunc(Buffer, lParam);
535 if (!Result) break;
537 }
538
540 return Result;
541}
Definition: bufpool.h:45
LPARAM lParam
Definition: combotst.c:139
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
__kernel_entry W32KAPI ULONG APIENTRY NtGdiEnumObjects(_In_ HDC hdc, _In_ INT iObjectType, _In_ ULONG cjBuf, _Out_writes_bytes_opt_(cjBuf) PVOID pvBuf)
#define OBJ_PEN
Definition: objidl.idl:1409
#define OBJ_BRUSH
Definition: objidl.idl:1410
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
void * PVOID
Definition: typedefs.h:50
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
struct tagLOGPEN LOGPEN
struct tagLOGBRUSH LOGBRUSH
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ GdiCleanCacheDC()

BOOL WINAPI GdiCleanCacheDC ( HDC  hdc)

Definition at line 390 of file dc.c.

391{
393 return TRUE;
395 return FALSE;
396}

◆ GdiConvertAndCheckDC()

HDC WINAPI GdiConvertAndCheckDC ( HDC  hdc)

Definition at line 403 of file dc.c.

404{
405 PLDC pldc;
408 return hdc;
409 pldc = GdiGetLDC(hdc);
410 if (pldc)
411 {
412 if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
413 if (pldc->Flags & LDC_KILL_DOCUMENT) return NULL;
414 if (pldc->Flags & LDC_STARTPAGE) StartPage(hdc);
415 return hdc;
416 }
418 return NULL;
419}
VOID GdiSAPCallback(PLDC pldc)
Definition: misc.c:819
@ GDILoObjType_LO_METADC16_TYPE
Definition: gdi_private.h:49
#define LDC_SAPCALLBACK
Definition: ntgdihdl.h:150
#define LDC_STARTPAGE
Definition: ntgdihdl.h:153
int WINAPI StartPage(_In_ HDC)

Referenced by AngleArc(), Arc(), ArcTo(), BitBlt(), Chord(), Ellipse(), ExtFloodFill(), ExtTextOutW(), FillRgn(), FrameRgn(), GdiAlphaBlend(), GdiGradientFill(), GdiTransparentBlt(), InvertRgn(), LineTo(), MaskBlt(), PatBlt(), Pie(), PlgBlt(), PolyBezier(), PolyBezierTo(), PolyDraw(), Polygon(), Polyline(), PolylineTo(), PolyPolygon(), PolyPolyline(), Rectangle(), RoundRect(), SetPixel(), StretchBlt(), and StretchDIBits().

◆ GdiReleaseDC()

BOOL WINAPI GdiReleaseDC ( HDC  hdc)

Definition at line 379 of file dc.c.

380{
381 return 0;
382}

Referenced by ReleaseDC().

◆ GdiSelectBitmap()

HBITMAP WINAPI GdiSelectBitmap ( _In_ HDC  hdc,
_In_ HBITMAP  hbmp 
)

Definition at line 1426 of file dc.c.

1429{
1430 return NtGdiSelectBitmap(hdc, hbmp);
1431}
HBITMAP hbmp
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiSelectBitmap(_In_ HDC hdc, _In_ HBITMAP hbm)

Referenced by SelectObject().

◆ GdiSelectBrush()

HBRUSH WINAPI GdiSelectBrush ( _In_ HDC  hdc,
_In_ HBRUSH  hbr 
)

Definition at line 1435 of file dc.c.

1438{
1439 PDC_ATTR pdcattr;
1440 HBRUSH hbrOld;
1441
1442 HANDLE_METADC(HBRUSH, SelectObject, NULL, hdc, hbr);
1443
1444 /* Get the DC attribute */
1445 pdcattr = GdiGetDcAttr(hdc);
1446 if (pdcattr == NULL)
1447 {
1449 return NULL;
1450 }
1451
1452 /* Get the current brush. If it matches the new brush, we're done */
1453 hbrOld = pdcattr->hbrush;
1454 if (hbrOld == hbr)
1455 return hbrOld;
1456
1457 /* Set the new brush and update dirty flags */
1458 pdcattr->hbrush = hbr;
1459 pdcattr->ulDirty_ |= DC_BRUSH_DIRTY;
1460 return hbrOld;
1461}
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:589
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:135
HANDLE hbrush
Definition: ntgdihdl.h:295
ULONG ulDirty_
Definition: ntgdihdl.h:294
HGDIOBJ WINAPI SelectObject(_In_ HDC hdc, _In_ HGDIOBJ hobj)
Definition: dc.c:1546

Referenced by SelectObject().

◆ GdiSelectFont()

HFONT WINAPI GdiSelectFont ( _In_ HDC  hdc,
_In_ HFONT  hfont 
)

Definition at line 1495 of file dc.c.

1498{
1499 PDC_ATTR pdcattr;
1500 HFONT hfontOld;
1501
1503
1504 /* Get the DC attribute */
1505 pdcattr = GdiGetDcAttr(hdc);
1506 if (pdcattr == NULL)
1507 {
1509 return NULL;
1510 }
1511
1512 /* Get the current font. If it matches the new font, we're done */
1513 hfontOld = pdcattr->hlfntNew;
1514 if (hfontOld == hfont)
1515 return hfontOld;
1516
1517 /* Set the new font and update dirty flags */
1518 pdcattr->hlfntNew = hfont;
1519 pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
1520 pdcattr->ulDirty_ |= DIRTY_CHARSET;
1521
1522 /* If the DC does not have a DIB section selected, try a batch command */
1523 if (!(pdcattr->ulDirty_ & DC_DIBSECTION))
1524 {
1525 PGDIBSOBJECT pgO;
1526
1528 if (pgO)
1529 {
1530 pgO->hgdiobj = hfont;
1531 return hfontOld;
1532 }
1533 }
1534
1535 /* We could not use the batch command, call win32k */
1536 return NtGdiSelectFont(hdc, hfont);
1537}
static HFONT hfont
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:381
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
#define DC_DIBSECTION
Definition: ntgdihdl.h:137
#define DIRTY_CHARSET
Definition: ntgdihdl.h:127
@ GdiBCSelObj
Definition: ntgdityp.h:92
HANDLE hlfntNew
Definition: ntgdihdl.h:330
HGDIOBJ hgdiobj
Definition: ntgdityp.h:560

Referenced by SelectObject().

◆ GdiSelectPen()

HPEN WINAPI GdiSelectPen ( _In_ HDC  hdc,
_In_ HPEN  hpen 
)

Definition at line 1465 of file dc.c.

1468{
1469 PDC_ATTR pdcattr;
1470 HPEN hpenOld;
1471
1473
1474 /* Get the DC attribute */
1475 pdcattr = GdiGetDcAttr(hdc);
1476 if (pdcattr == NULL)
1477 {
1479 return NULL;
1480 }
1481
1482 /* Get the current pen. If it matches the new pen, we're done */
1483 hpenOld = pdcattr->hpen;
1484 if (hpenOld == hpen)
1485 return hpenOld;
1486
1487 /* Set the new pen and update dirty flags */
1488 pdcattr->ulDirty_ |= DC_PEN_DIRTY;
1489 pdcattr->hpen = hpen;
1490 return hpenOld;
1491}
static HPEN hpen
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:136
HANDLE hpen
Definition: ntgdihdl.h:296

Referenced by SelectObject().

◆ GetAndSetDCDWord()

DWORD WINAPI GetAndSetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId,
_In_ USHORT  usMF16Id,
_In_ DWORD  dwError 
)

Definition at line 746 of file dc.c.

753{
754 DWORD dwResult;
755 PLDC pldc;
756
758 ulMFId != EMR_MAX + 1 )
759 {
761 {
762 return METADC_SetD( hdc, dwIn, usMF16Id );
763 }
764 pldc = GdiGetLDC(hdc);
765 if ( pldc->iType == LDC_EMFLDC)
766 {
767 if (!EMFDC_SetD( pldc, dwIn, ulMFId ))
768 return 0;
769 }
770 }
771
772 /* Call win32k to do the real work */
773 if (!NtGdiGetAndSetDCDword(hdc, u, dwIn, &dwResult))
774 {
775 return dwError;
776 }
777
778 return dwResult;
779}
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI EMFDC_SetD(_In_ PLDC pldc, _In_ DWORD dwIn, _In_ ULONG ulMFId)
Definition: rosglue.c:331
BOOL WINAPI METADC_SetD(_In_ HDC hdc, _In_ DWORD dwIn, _In_ USHORT usMF16Id)
Definition: rosglue.c:312
#define LDC_EMFLDC
Definition: gdi_private.h:105
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
_In_ UINT _In_ DWORD dwIn
Definition: ntgdi.h:249
INT iType
Definition: ntgdihdl.h:266

Referenced by SetArcDirection(), SetMapMode(), and SetRelAbs().

◆ GetArcDirection()

INT WINAPI GetArcDirection ( _In_ HDC  hdc)

Definition at line 358 of file dc.c.

360{
361 return GetDCDWord( hdc, GdiGetArcDirection, 0);
362}
@ GdiGetArcDirection
Definition: ntgdityp.h:52
DWORD WINAPI GetDCDWord(_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
Definition: dc.c:787

Referenced by eto_emf_enum_proc(), and test_ExtTextOut().

◆ GetAspectRatioFilterEx()

BOOL WINAPI GetAspectRatioFilterEx ( HDC  hdc,
LPSIZE  lpAspectRatio 
)

Definition at line 808 of file dc.c.

811{
812 return NtGdiGetDCPoint(hdc, GdiGetAspectRatioFilter, (PPOINTL)lpAspectRatio );
813}
BOOL APIENTRY NtGdiGetDCPoint(HDC hDC, UINT iPoint, PPOINTL Point)
Definition: coord.c:1424
@ GdiGetAspectRatioFilter
Definition: ntgdityp.h:79

◆ GetBkColor()

COLORREF WINAPI GetBkColor ( _In_ HDC  hdc)

Definition at line 978 of file dc.c.

980{
981 PDC_ATTR pdcattr;
982
983 /* Get the DC attribute */
984 pdcattr = GdiGetDcAttr(hdc);
985 if (pdcattr == NULL)
986 {
987 /* Don't set LastError here! */
988 return CLR_INVALID;
989 }
990
991 return pdcattr->ulBackgroundClr;
992}
ULONG ulBackgroundClr
Definition: ntgdihdl.h:298
#define CLR_INVALID
Definition: wingdi.h:883

Referenced by cd_wndproc(), draw_graphics(), EDIT_PaintText(), EMFDC_MaskBlt(), EMFDC_PlgBlt(), EMFDRV_StretchBlt(), emfdrv_stretchblt(), eto_emf_enum_proc(), HEADER_FillItemFrame(), ImageList_DrawIndirect(), LISTVIEW_Refresh(), MaskBlt(), parent_wnd_proc(), PlgBlt(), REBAR_EraseBkGnd(), SS_ItemOut(), test_dc_values(), test_ExtTextOut(), test_mf_SaveDC(), test_SaveDC(), Test_SrcMono1(), and ZoomWnd_OnDraw().

◆ GetBkMode()

int WINAPI GetBkMode ( HDC  hdc)

Definition at line 1035 of file dc.c.

1036{
1037 PDC_ATTR pdcattr;
1038
1039 /* Get the DC attribute */
1040 pdcattr = GdiGetDcAttr(hdc);
1041 if (pdcattr == NULL)
1042 {
1043 /* Don't set LastError here! */
1044 return 0;
1045 }
1046
1047 return pdcattr->lBkMode;
1048}
LONG lBkMode
Definition: ntgdihdl.h:313

◆ GetBoundsRect()

UINT WINAPI GetBoundsRect ( HDC  hdc,
LPRECT  lprcBounds,
UINT  flags 
)

Definition at line 821 of file dc.c.

826{
827 return NtGdiGetBoundsRect(hdc,lprcBounds,flags & ~DCB_WINDOWMGR);
828}
DWORD APIENTRY NtGdiGetBoundsRect(IN HDC hdc, OUT LPRECT prc, IN DWORD flags)
Definition: dcutil.c:708
#define DCB_WINDOWMGR
Definition: gdi_private.h:62
GLbitfield flags
Definition: glext.h:7161

◆ GetClipBox()

int WINAPI GetClipBox ( HDC  hdc,
LPRECT  lprc 
)

Definition at line 851 of file dc.c.

853{
854 return NtGdiGetAppClipBox(hdc, lprc);
855}
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4466

◆ GetCurrentObject()

HGDIOBJ WINAPI GetCurrentObject ( _In_ HDC  hdc,
_In_ UINT  uObjectType 
)

Definition at line 428 of file dc.c.

431{
432 PDC_ATTR pdcattr = NULL;
433
434 /* Check if this is a user mode object */
435 if ((uObjectType == OBJ_PEN) ||
436 (uObjectType == OBJ_EXTPEN) ||
437 (uObjectType == OBJ_BRUSH) ||
438 (uObjectType == OBJ_COLORSPACE))
439 {
440 /* Get the DC attribute */
441 pdcattr = GdiGetDcAttr(hdc);
442 if (pdcattr == NULL)
443 {
444 return NULL;
445 }
446 }
447
448 /* Check what object was requested */
449 switch (uObjectType)
450 {
451 case OBJ_EXTPEN:
452 case OBJ_PEN:
453 return pdcattr->hpen;
454
455 case OBJ_BRUSH:
456 return pdcattr->hbrush;
457
458 case OBJ_COLORSPACE:
459 return pdcattr->hColorSpace;
460
461 case OBJ_PAL:
462 uObjectType = GDI_OBJECT_TYPE_PALETTE;
463 break;
464
465 case OBJ_FONT:
466 uObjectType = GDI_OBJECT_TYPE_FONT;
467 break;
468
469 case OBJ_BITMAP:
470 uObjectType = GDI_OBJECT_TYPE_BITMAP;
471 break;
472
473 /* All others are invalid */
474 default:
476 return NULL;
477 }
478
479 /* Pass the request to win32k */
480 return NtGdiGetDCObject(hdc, uObjectType);
481}
#define GDI_OBJECT_TYPE_BITMAP
Definition: gdi.h:48
#define GDI_OBJECT_TYPE_PALETTE
Definition: gdi.h:49
#define GDI_OBJECT_TYPE_FONT
Definition: gdi.h:50
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiGetDCObject(_In_ HDC hdc, _In_ INT itype)
#define OBJ_EXTPEN
Definition: objidl.idl:1419
#define OBJ_FONT
Definition: objidl.idl:1414
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define OBJ_PAL
Definition: objidl.idl:1413
HCOLORSPACE hColorSpace
Definition: ntgdihdl.h:319
#define OBJ_COLORSPACE
Definition: wingdi.h:704

Referenced by ANIMATE_EraseBackground(), ANIMATE_PaintFrame(), buffer_size(), check_item_height(), close_preview(), D3DXCreateTextW(), DrawClock(), DrawShadowText(), EDIT_PaintText(), EMFDC_MaskBlt(), EMFDC_PlgBlt(), EMFDC_SetDCBrushColor(), EMFDC_SetDCPenColor(), EMFDRV_SetDCBrushColor(), EMFDRV_SetDCPenColor(), EMFDRV_StretchBlt(), emfdrv_stretchblt(), EnumEnhMetaFile(), EnumMetaFile(), eto_emf_enum_proc(), fnIMLangFontLink2_MapFont(), GdipCreateFontFromDC(), GdipCreateFromHDC2(), get_bitmap_info(), get_graphics_device_bounds(), GuiReleaseScreenBuffer(), init_script_cache(), IntDrawState(), InternalSelectEx(), IntGrayString(), metadc_stretchblt(), MFDRV_StretchBlt(), OLEPictureImpl_SetBitmap(), PaintRgn(), parent_wnd_proc(), PlayEnhMetaFileRecord(), PlayMetaFile(), ScriptStringAnalyse(), SetDIBits(), START_TEST(), sw_SetContext(), test_bitmap_colors(), test_button_messages(), test_CreateBitmap(), test_createtext(), test_D3DKMTCreateDCFromMemory(), test_font_metrics(), test_gdi_objects(), Test_GetCurrentObject(), test_GetCurrentObject(), test_item_height(), test_MapFont(), test_mono_bitmap(), test_ScriptShape(), and wglUseFontOutlines_common().

◆ GetDCBrushColor()

COLORREF WINAPI GetDCBrushColor ( _In_ HDC  hdc)

Definition at line 863 of file dc.c.

865{
866 PDC_ATTR pdcattr;
867
868 /* Get the DC attribute */
869 pdcattr = GdiGetDcAttr(hdc);
870 if (pdcattr == NULL)
871 {
873 return CLR_INVALID;
874 }
875
876 return pdcattr->ulBrushClr;
877}
ULONG ulBrushClr
Definition: ntgdihdl.h:302

Referenced by Test_IsSpecialState().

◆ GetDCDWord()

DWORD WINAPI GetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwError 
)

Definition at line 787 of file dc.c.

791{
792 DWORD dwResult;
793
794 if (!NtGdiGetDCDword(hdc, u, &dwResult))
795 {
796 return dwError;
797 }
798
799 return dwResult;
800}
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetDCDword(_In_ HDC hdc, _In_ UINT u, _Out_ DWORD *Result)

Referenced by EMFDC_RestoreDC(), GetArcDirection(), GetFontLanguageInfo(), GetObjectType(), and GetRelAbs().

◆ GetDCPenColor()

COLORREF WINAPI GetDCPenColor ( _In_ HDC  hdc)

Definition at line 884 of file dc.c.

886{
887 PDC_ATTR pdcattr;
888
889 /* Get the DC attribute */
890 pdcattr = GdiGetDcAttr(hdc);
891 if (pdcattr == NULL)
892 {
894 return CLR_INVALID;
895 }
896
897 return pdcattr->ulPenClr;
898}
ULONG ulPenClr
Definition: ntgdihdl.h:304

Referenced by Test_IsSpecialState().

◆ GetDeviceCaps()

int WINAPI GetDeviceCaps ( _In_ HDC  hdc,
_In_ int  nIndex 
)

Definition at line 550 of file dc.c.

553{
554 PDC_ATTR pdcattr;
555 PLDC pldc;
557 PDEVCAPS pDevCaps = GdiDevCaps; // Primary display device capabilities.
558 DPRINT("Device CAPS1\n");
559
560 HANDLE_METADC16(INT, GetDeviceCaps, 0, hdc, nIndex);
561
563 {
564 pldc = GdiGetLDC(hdc);
565 if ( !pldc )
566 {
568 return 0;
569 }
570 if (!(pldc->Flags & LDC_DEVCAPS) )
571 {
572 if (!NtGdiGetDeviceCapsAll(hdc, &pldc->DevCaps) )
574
575 pldc->Flags |= LDC_DEVCAPS;
576 }
577 pDevCaps = &pldc->DevCaps;
578 }
579 else
580 {
581 /* Get the DC attribute */
582 pdcattr = GdiGetDcAttr(hdc);
583 if ( pdcattr == NULL )
584 {
586 return 0;
587 }
588
589 if (!(pdcattr->ulDirty_ & DC_PRIMARY_DISPLAY))
590 return NtGdiGetDeviceCaps(hdc, nIndex);
591 }
592
593 switch (nIndex)
594 {
595 case DRIVERVERSION:
596 return pDevCaps->ulVersion;
597
598 case TECHNOLOGY:
599 return pDevCaps->ulTechnology;
600
601 case HORZSIZE:
602 return pDevCaps->ulHorzSize;
603
604 case VERTSIZE:
605 return pDevCaps->ulVertSize;
606
607 case HORZRES:
608 return pDevCaps->ulHorzRes;
609
610 case VERTRES:
611 return pDevCaps->ulVertRes;
612
613 case LOGPIXELSX:
614 return pDevCaps->ulLogPixelsX;
615
616 case LOGPIXELSY:
617 return pDevCaps->ulLogPixelsY;
618
619 case BITSPIXEL:
620 return pDevCaps->ulBitsPixel;
621
622 case PLANES:
623 return pDevCaps->ulPlanes;
624
625 case NUMBRUSHES:
626 return -1;
627
628 case NUMPENS:
629 return pDevCaps->ulNumPens;
630
631 case NUMFONTS:
632 return pDevCaps->ulNumFonts;
633
634 case NUMCOLORS:
635 return pDevCaps->ulNumColors;
636
637 case ASPECTX:
638 return pDevCaps->ulAspectX;
639
640 case ASPECTY:
641 return pDevCaps->ulAspectY;
642
643 case ASPECTXY:
644 return pDevCaps->ulAspectXY;
645
646 case CLIPCAPS:
647 return CP_RECTANGLE;
648
649 case SIZEPALETTE:
650 return pDevCaps->ulSizePalette;
651
652 case NUMRESERVED:
653 return 20;
654
655 case COLORRES:
656 return pDevCaps->ulColorRes;
657
658 case DESKTOPVERTRES:
659 return pDevCaps->ulVertRes;
660
661 case DESKTOPHORZRES:
662 return pDevCaps->ulHorzRes;
663
664 case BLTALIGNMENT:
665 return pDevCaps->ulBltAlignment;
666
667 case SHADEBLENDCAPS:
668 return pDevCaps->ulShadeBlend;
669
670 case COLORMGMTCAPS:
672
673 case PHYSICALWIDTH:
675
676 case PHYSICALHEIGHT:
678
679 case PHYSICALOFFSETX:
681
682 case PHYSICALOFFSETY:
684
685 case VREFRESH:
686 return pDevCaps->ulVRefresh;
687
688 case RASTERCAPS:
689 return pDevCaps->ulRasterCaps;
690
691 case CURVECAPS:
694
695 case LINECAPS:
698
699 case POLYGONALCAPS:
702
703 case TEXTCAPS:
704 return pDevCaps->ulTextCaps;
705
706 case PDEVICESIZE:
707 case SCALINGFACTORX:
708 case SCALINGFACTORY:
709 default:
710 return 0;
711 }
712 return 0;
713}
#define HANDLE_METADC16(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:613
PDEVCAPS GdiDevCaps
Definition: dllmain.c:10
__kernel_entry W32KAPI INT APIENTRY NtGdiGetDeviceCaps(_In_ HDC hdc, _In_ INT i)
_Out_ PDEVCAPS pDevCaps
Definition: ntgdi.h:2664
#define DC_PRIMARY_DISPLAY
Definition: ntgdihdl.h:139
#define LDC_DEVCAPS
Definition: ntgdihdl.h:166
#define DPRINT
Definition: sndvol32.h:73
ULONG ulVertSize
Definition: ntgdityp.h:303
ULONG ulPhysicalOffsetX
Definition: ntgdityp.h:321
ULONG ulNumFonts
Definition: ntgdityp.h:309
ULONG ulTechnology
Definition: ntgdityp.h:299
ULONG ulTextCaps
Definition: ntgdityp.h:323
ULONG ulAspectY
Definition: ntgdityp.h:313
ULONG ulLogPixelsX
Definition: ntgdityp.h:315
ULONG ulLogPixelsY
Definition: ntgdityp.h:316
ULONG ulVersion
Definition: ntgdityp.h:298
ULONG ulAspectX
Definition: ntgdityp.h:312
ULONG ulHorzSize
Definition: ntgdityp.h:302
ULONG ulBltAlignment
Definition: ntgdityp.h:327
ULONG ulSizePalette
Definition: ntgdityp.h:317
ULONG ulBitsPixel
Definition: ntgdityp.h:306
ULONG ulColorMgmtCaps
Definition: ntgdityp.h:333
ULONG ulHorzRes
Definition: ntgdityp.h:304
ULONG ulPhysicalHeight
Definition: ntgdityp.h:320
ULONG ulColorRes
Definition: ntgdityp.h:318
ULONG ulNumPens
Definition: ntgdityp.h:308
ULONG ulPhysicalOffsetY
Definition: ntgdityp.h:322
ULONG ulPhysicalWidth
Definition: ntgdityp.h:319
ULONG ulVertRes
Definition: ntgdityp.h:305
ULONG ulRasterCaps
Definition: ntgdityp.h:311
ULONG ulNumColors
Definition: ntgdityp.h:310
ULONG ulShadeBlend
Definition: ntgdityp.h:332
ULONG ulAspectXY
Definition: ntgdityp.h:314
ULONG ulPlanes
Definition: ntgdityp.h:307
ULONG ulVRefresh
Definition: ntgdityp.h:324
DEVCAPS DevCaps
Definition: ntgdihdl.h:280
int32_t INT
Definition: typedefs.h:58
#define NUMRESERVED
Definition: wingdi.h:733
#define PHYSICALOFFSETY
Definition: wingdi.h:738
#define NUMBRUSHES
Definition: wingdi.h:722
#define LC_WIDESTYLED
Definition: wingdi.h:777
#define RASTERCAPS
Definition: wingdi.h:745
#define CC_CIRCLES
Definition: wingdi.h:761
#define HORZRES
Definition: wingdi.h:716
#define CC_WIDESTYLED
Definition: wingdi.h:767
#define ASPECTX
Definition: wingdi.h:727
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define PC_RECTANGLE
Definition: wingdi.h:797
#define CC_WIDE
Definition: wingdi.h:765
#define CC_INTERIORS
Definition: wingdi.h:768
#define PHYSICALHEIGHT
Definition: wingdi.h:736
#define CP_RECTANGLE
Definition: wingdi.h:826
#define COLORRES
Definition: wingdi.h:734
#define SCALINGFACTORX
Definition: wingdi.h:739
#define BLTALIGNMENT
Definition: wingdi.h:744
#define LC_STYLED
Definition: wingdi.h:776
#define PC_SCANLINE
Definition: wingdi.h:799
#define VERTSIZE
Definition: wingdi.h:715
#define LOGPIXELSY
Definition: wingdi.h:719
#define PHYSICALOFFSETX
Definition: wingdi.h:737
#define SIZEPALETTE
Definition: wingdi.h:732
#define DRIVERVERSION
Definition: wingdi.h:705
#define NUMCOLORS
Definition: wingdi.h:725
#define POLYGONALCAPS
Definition: wingdi.h:779
#define CC_ELLIPSES
Definition: wingdi.h:764
#define LC_POLYMARKER
Definition: wingdi.h:774
#define HORZSIZE
Definition: wingdi.h:714
#define PDEVICESIZE
Definition: wingdi.h:730
#define TEXTCAPS
Definition: wingdi.h:806
#define SCALINGFACTORY
Definition: wingdi.h:740
#define VREFRESH
Definition: wingdi.h:741
#define VERTRES
Definition: wingdi.h:717
#define LC_POLYLINE
Definition: wingdi.h:772
#define CC_ROUNDRECT
Definition: wingdi.h:769
#define PC_WINDPOLYGON
Definition: wingdi.h:798
#define CURVECAPS
Definition: wingdi.h:759
#define PHYSICALWIDTH
Definition: wingdi.h:735
#define PC_WIDE
Definition: wingdi.h:801
#define LC_WIDE
Definition: wingdi.h:775
#define PLANES
Definition: wingdi.h:721
#define DESKTOPHORZRES
Definition: wingdi.h:742
#define CC_PIE
Definition: wingdi.h:762
#define LOGPIXELSX
Definition: wingdi.h:718
#define CC_STYLED
Definition: wingdi.h:766
#define BITSPIXEL
Definition: wingdi.h:720
#define PC_STYLED
Definition: wingdi.h:802
#define CC_CHORD
Definition: wingdi.h:763
#define NUMFONTS
Definition: wingdi.h:724
#define PC_INTERIORS
Definition: wingdi.h:804
#define LC_INTERIORS
Definition: wingdi.h:778
#define PC_POLYGON
Definition: wingdi.h:794
#define LINECAPS
Definition: wingdi.h:770
#define ASPECTY
Definition: wingdi.h:728
#define NUMPENS
Definition: wingdi.h:723
#define LC_MARKER
Definition: wingdi.h:773
#define DESKTOPVERTRES
Definition: wingdi.h:743
#define CLIPCAPS
Definition: wingdi.h:731
#define ASPECTXY
Definition: wingdi.h:729
#define TECHNOLOGY
Definition: wingdi.h:706
#define PC_WIDESTYLED
Definition: wingdi.h:803

◆ GetGraphicsMode()

int WINAPI GetGraphicsMode ( HDC  hdc)

Definition at line 1212 of file dc.c.

1213{
1214 PDC_ATTR pdcattr;
1215
1216 /* Get the DC attribute */
1217 pdcattr = GdiGetDcAttr(hdc);
1218 if (pdcattr == NULL)
1219 {
1220 /* Don't set LastError here! */
1221 return 0;
1222 }
1223
1224 /* Return current graphics mode */
1225 return pdcattr->iGraphicsMode;
1226}
INT iGraphicsMode
Definition: ntgdihdl.h:306

◆ GetHFONT()

HFONT WINAPI GetHFONT ( HDC  hdc)

Definition at line 1406 of file dc.c.

1407{
1408 PDC_ATTR pdcattr;
1409
1410 /* Get the DC attribute */
1411 pdcattr = GdiGetDcAttr(hdc);
1412 if (pdcattr == NULL)
1413 {
1414 /* Don't set LastError here! */
1415 return NULL;
1416 }
1417
1418 /* Return the current font */
1419 return pdcattr->hlfntNew;
1420}

◆ GetPolyFillMode()

int WINAPI GetPolyFillMode ( HDC  hdc)

Definition at line 1153 of file dc.c.

1154{
1155 PDC_ATTR pdcattr;
1156
1157 /* Get DC attribute */
1158 pdcattr = GdiGetDcAttr(hdc);
1159 if (pdcattr == NULL)
1160 {
1161 /* Don't set LastError here! */
1162 return 0;
1163 }
1164
1165 /* Return current fill mode */
1166 return pdcattr->lFillMode;
1167}
LONG lFillMode
Definition: ntgdihdl.h:314

◆ GetRelAbs()

DWORD WINAPI GetRelAbs ( _In_ HDC  hdc,
_In_ DWORD  dwIgnore 
)

Definition at line 720 of file dc.c.

723{
724 return GetDCDWord(hdc, GdiGetRelAbs, 0);
725}
@ GdiGetRelAbs
Definition: ntgdityp.h:49

Referenced by init_function_pointers().

◆ GetROP2()

int WINAPI GetROP2 ( _In_ HDC  hdc)

Definition at line 1093 of file dc.c.

1095{
1096 PDC_ATTR pdcattr;
1097
1098 /* Get the DC attribute */
1099 pdcattr = GdiGetDcAttr(hdc);
1100 if (pdcattr == NULL)
1101 {
1102 /* Do not set LastError here! */
1103 return 0;
1104 }
1105
1106 return pdcattr->jROP2;
1107}
BYTE jROP2
Definition: ntgdihdl.h:307

Referenced by eto_emf_enum_proc(), Poly(), RectSel(), test_dc_attributes(), test_destroyed_window(), and test_ExtTextOut().

◆ GetStretchBltMode()

int WINAPI GetStretchBltMode ( HDC  hdc)

Definition at line 1353 of file dc.c.

1354{
1355 PDC_ATTR pdcattr;
1356
1357 /* Get the DC attribute */
1358 pdcattr = GdiGetDcAttr(hdc);
1359 if (pdcattr == NULL)
1360 {
1361 /* Don't set LastError here! */
1362 return 0;
1363 }
1364
1365 return pdcattr->lStretchBltMode;
1366}
LONG lStretchBltMode
Definition: ntgdihdl.h:315

◆ IntCreateDICW()

HDC FASTCALL IntCreateDICW ( LPCWSTR  lpwszDriver,
LPCWSTR  lpwszDevice,
LPCWSTR  lpwszOutput,
PDEVMODEW  lpInitData,
ULONG  iType 
)

Definition at line 8 of file dc.c.

14{
16 HDC hdc = NULL;
18 HANDLE UMdhpdev = 0;
19
20 HANDLE hspool = NULL;
21
22 if ( !ghSpooler && !LoadTheSpoolerDrv())
23 {
24 DPRINT1("WinSpooler.Drv Did not load!\n");
25 }
26 else
27 {
28 DPRINT("WinSpooler.Drv Loaded! hMod -> 0x%p\n", ghSpooler);
29 }
30
31 if ((!lpwszDevice) && (!lpwszDriver))
32 {
33 Default = TRUE; // Ask Win32k to set Default device.
34 Display = TRUE; // Most likely to be DISPLAY.
35 }
36 else
37 {
38 if ((lpwszDevice) && (wcslen(lpwszDevice) != 0)) // First
39 {
40 if (!_wcsnicmp(lpwszDevice, L"\\\\.\\DISPLAY",11)) Display = TRUE;
41 RtlInitUnicodeString(&Device, lpwszDevice);
42 }
43 else
44 {
45 if (lpwszDriver) // Second
46 {
47 if ((!_wcsnicmp(lpwszDriver, L"DISPLAY",7)) ||
48 (!_wcsnicmp(lpwszDriver, L"\\\\.\\DISPLAY",11))) Display = TRUE;
49 RtlInitUnicodeString(&Device, lpwszDriver);
50 }
51 }
52 }
53
54 if (lpwszOutput) RtlInitUnicodeString(&Output, lpwszOutput);
55
56 // Handle Print device or something else.
57 if (!Display)
58 {
59 // WIP - GDI Print Commit coming in soon.
60 DPRINT1("Not a DISPLAY device! %wZ\n", &Device);
61 return NULL; // Return NULL until then.....
62 }
63
64 hdc = NtGdiOpenDCW((Default ? NULL : &Device),
65 (PDEVMODEW) lpInitData,
66 (lpwszOutput ? &Output : NULL),
67 iType, // DCW 0 and ICW 1.
68 Display,
69 hspool,
70 &UMdhpdev );
71#if 0
72// Handle something other than a normal dc object.
74 {
75 PDC_ATTR Dc_Attr;
76 PLDC pLDC;
77
79
80 pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC));
81
82 Dc_Attr->pvLDC = pLDC;
83 pLDC->hDC = hdc;
84 pLDC->iType = LDC_LDC; // 1 (init) local DC, 2 EMF LDC
85 DbgPrint("DC_ATTR Allocated -> 0x%x\n",Dc_Attr);
86 }
87#endif
88 return hdc;
89}
#define DPRINT1
Definition: precomp.h:8
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE ghSpooler
Definition: printdrv.c:40
BOOL FASTCALL LoadTheSpoolerDrv(VOID)
Definition: printdrv.c:188
#define LDC_LDC
Definition: gdi_private.h:104
#define DbgPrint
Definition: hal.h:12
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
@ Default
Definition: stdole2.idl:392
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
__kernel_entry W32KAPI HDC APIENTRY NtGdiOpenDCW(_In_opt_ PUNICODE_STRING pustrDevice, _In_ DEVMODEW *pdm, _In_ PUNICODE_STRING pustrLogAddr, _In_ ULONG iType, _In_ BOOL bDisplay, _In_opt_ HANDLE hspool, _At_((PUMDHPDEV *) pUMdhpdev, _Out_) PVOID pUMdhpdev)
Definition: dclife.c:694
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
@ Output
Definition: arc.h:85
PVOID pvLDC
Definition: ntgdihdl.h:293
HDC hDC
Definition: ntgdihdl.h:264
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define LMEM_ZEROINIT
Definition: winbase.h:375
_In_ ULONG iType
Definition: winddi.h:3748
int Display
Definition: x11stubs.h:25

Referenced by CreateDCA(), CreateDCW(), CreateICA(), and CreateICW().

◆ NtUserSelectPalette()

HPALETTE WINAPI NtUserSelectPalette ( HDC  hDC,
HPALETTE  hpal,
BOOL  ForceBackground 
)

Select logical palette into device context.

Parameters
hDChandle to the device context
hpalhandle to the palette
ForceBackgroundIf this value is FALSE the logical palette will be copied to the device palette only when the application is in the foreground. If this value is TRUE then map the colors in the logical palette to the device palette colors in the best way.
Returns
old palette
Todo:
implement ForceBackground == TRUE

Definition at line 1034 of file windc.c.

1037{
1038 HPALETTE oldPal;
1040 // Implement window checks
1041 oldPal = GdiSelectPalette( hDC, hpal, ForceBackground);
1042 UserLeave();
1043 return oldPal;
1044}
HPALETTE NTAPI GdiSelectPalette(_In_ HDC hDC, _In_ HPALETTE hpal, _In_ BOOL ForceBackground)
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:258
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:249

Referenced by SelectPalette(), and START_TEST().

◆ ResetDCA()

HDC WINAPI ResetDCA ( _In_ HDC  hdc,
_In_ CONST DEVMODEA lpInitData 
)

Definition at line 1298 of file dc.c.

1301{
1302 LPDEVMODEW InitDataW;
1303
1304 InitDataW = GdiConvertToDevmodeW((LPDEVMODEA)lpInitData);
1305
1306 NtGdiResetDC ( hdc, InitDataW, NULL, NULL, NULL);
1307 HEAP_free(InitDataW);
1308 return hdc;
1309}
__kernel_entry W32KAPI BOOL APIENTRY NtGdiResetDC(_In_ HDC hdc, _In_ LPDEVMODEW pdm, _Out_ PBOOL pbBanding, _In_opt_ DRIVER_INFO_2W *pDriverInfo2, _At_((PUMDHPDEV *) ppUMdhpdev, _Out_) PVOID ppUMdhpdev)
Definition: dcstate.c:122

◆ ResetDCW()

HDC WINAPI ResetDCW ( _In_ HDC  hdc,
_In_ CONST DEVMODEW lpInitData 
)

Definition at line 1284 of file dc.c.

1287{
1288 NtGdiResetDC ( hdc, (PDEVMODEW)lpInitData, NULL, NULL, NULL);
1289 return hdc;
1290}

◆ RestoreDC()

BOOL WINAPI RestoreDC ( IN HDC  hdc,
IN INT  iLevel 
)

Definition at line 315 of file dc.c.

317{
319 return NtGdiRestoreDC(hdc, iLevel);
320}
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRestoreDC(_In_ HDC hdc, _In_ INT iLevel)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ SaveDC()

INT WINAPI SaveDC ( IN HDC  hdc)

Definition at line 303 of file dc.c.

304{
306 return NtGdiSaveDC(hdc);
307}
#define HANDLE_METADC1P(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:666
__kernel_entry W32KAPI INT APIENTRY NtGdiSaveDC(_In_ HDC hdc)
int WINAPI SaveDC(_In_ HDC)

◆ SelectObject()

HGDIOBJ WINAPI SelectObject ( _In_ HDC  hdc,
_In_ HGDIOBJ  hobj 
)

Definition at line 1546 of file dc.c.

1549{
1550 /* Fix up 16 bit handles */
1551 hobj = GdiFixUpHandle(hobj);
1552 if (!GdiValidateHandle(hobj))
1553 {
1554 return NULL;
1555 }
1556
1557 /* Call the appropriate select function */
1558 switch (GDI_HANDLE_GET_TYPE(hobj))
1559 {
1562
1565 return GdiSelectBitmap(hdc, hobj);
1566
1568 return GdiSelectBrush(hdc, hobj);
1569
1572 return GdiSelectPen(hdc, hobj);
1573
1575 return GdiSelectFont(hdc, hobj);
1576
1578 return SetColorSpace(hdc, hobj);
1579
1582
1583 default:
1584 return NULL;
1585 }
1586
1587 return NULL;
1588}
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
BOOL WINAPI GdiValidateHandle(HGDIOBJ)
Definition: misc.c:712
HGDIOBJ WINAPI GdiFixUpHandle(HGDIOBJ hGO)
Definition: misc.c:734
@ GDILoObjType_LO_FONT_TYPE
Definition: gdi_private.h:37
@ GDILoObjType_LO_PALETTE_TYPE
Definition: gdi_private.h:36
@ GDILoObjType_LO_BRUSH_TYPE
Definition: gdi_private.h:33
@ GDILoObjType_LO_BITMAP_TYPE
Definition: gdi_private.h:35
@ GDILoObjType_LO_REGION_TYPE
Definition: gdi_private.h:38
@ GDILoObjType_LO_EXTPEN_TYPE
Definition: gdi_private.h:45
@ GDILoObjType_LO_ICMLCS_TYPE
Definition: gdi_private.h:39
@ GDILoObjType_LO_PEN_TYPE
Definition: gdi_private.h:44
@ GDILoObjType_LO_DIBSECTION_TYPE
Definition: gdi_private.h:46
HBRUSH WINAPI GdiSelectBrush(_In_ HDC hdc, _In_ HBRUSH hbr)
Definition: dc.c:1435
HFONT WINAPI GdiSelectFont(_In_ HDC hdc, _In_ HFONT hfont)
Definition: dc.c:1495
HPEN WINAPI GdiSelectPen(_In_ HDC hdc, _In_ HPEN hpen)
Definition: dc.c:1465
HBITMAP WINAPI GdiSelectBitmap(_In_ HDC hdc, _In_ HBITMAP hbmp)
Definition: dc.c:1426
HCOLORSPACE WINAPI SetColorSpace(_In_ HDC, _In_ HCOLORSPACE)
#define RGN_COPY
Definition: wingdi.h:357
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)

Referenced by _find_font_for_range(), CMenuDeskBar::_OnPaint(), _Success_(), AboutDlgProc(), add_ruler_units(), add_with_alpha(), AddDlg_OnInitDialog(), alpha_blend_hdc_pixels(), alpha_blend_image(), AlphaBlendInit(), ANIMATE_PaintFrame(), ANIMATE_TransparentBlt(), AppearancePage_OnInit(), Bezier(), BitBltFromClipboard(), BITMAP_CopyImage(), BITMAP_LoadImageW(), BitmapFromHEMF(), BitmapFromIcon(), BitmapToClipboardDIB(), Brush(), brush_fill_path(), BuildFont(), BuildMaskFromPoints(), BUTTON_CalcLabelRect(), C1_DrawConvexRect(), C1_DrawDragBorder(), C1_DrawLabel(), C1_InitBitmap(), C1_OnButtonDown(), C1_OnButtonUp(), C1_OnCreate(), C1_OnDraw(), C1_OnMouseMove(), C1_SetData(), Pane::calc_single_width(), Pane::calc_widths(), CalculateCharWidth(), CDimmedWindow::Capture(), CaptureScreen(), CardImageWndProc(), CB_Paint(), CB_ThemedPaint(), CBGetTextAreaHeight(), CBPaintText(), CC_PaintCross(), CC_PaintTriangle(), CC_PrepareColorGraph(), cdtDrawExt(), CFn_WMDrawItem(), CFn_WMMeasureItem(), CFn_WMPaint(), check_height_font_enumproc(), check_vertical_font(), check_vertical_metrics(), Child_OnPaint(), cicChangeBitmapColor(), clear_frontbuffer(), ClockWndProc(), ColorKeyedMaskBlt(), COMBO_Init(), COMBO_Paint(), COMCTL32_DrawInsertMark(), COMCTL32_EnsureBitmapSize(), COMCTL32_GetFontMetrics(), ConfigDlgProc(), ConfirmMsgBox_Init(), ConfirmMsgBox_Paint(), SEALED_::ControlWindowProc(), ConvertBitmapTo32Bpp(), ConWndProc(), CopyMonoImage(), create_alpha_bitmap(), create_bitmap(), create_render_dc(), create_taskdialog_template(), CCicLibMenuItem::CreateBitmap(), CreateCheckImage(), CreateCheckMask(), CreateColorDIB(), CreateDragImage(), CreateLayoutIcon(), CreateMappedBitmap(), CreateMatrix(), CreateMDIMenuBitmap(), CreateMonoBitmap(), CreateRadioImage(), CreateRadioMask(), CShellLink::CreateShortcutIcon(), CreateSinkBmp(), CreateStarBitmap(), CreateStateImageList(), CreateTrayIcon(), ctrl_resize(), CURSORICON_GetCursorDataFromBMI(), CURSORICON_GetCursorDataFromIconInfo(), D3DXCreateFontIndirectW(), D3DXCreateTextTest(), D3DXCreateTextW(), DATETIME_GetIdealSize(), DATETIME_Refresh(), default_page_paint_hook(), delete_render_dc(), device_load_logo(), DIALOG_CreateIndirect(), RdpClientUI::Display_DestBlt(), RdpClientUI::Display_DrawGlyph(), Display_DrawText(), RdpClientUI::Display_DrawText(), RdpClientUI::Display_Line(), RdpClientUI::Display_MemBlt(), RdpClientUI::Display_PatBlt(), RdpClientUI::Display_Polygon(), RdpClientUI::Display_Polyline(), RdpClientUI::Display_Rect(), Display_SetTypeFace(), RdpClientUI::Display_TriBlt(), DisplayDlgProc(), DlgProc(), DoBlt(), CCanvasWindow::DoDraw(), DoEntry(), DoPrintDocument(), DoPrintPage(), DoTestEntry(), Draw(), CardButton::Draw(), draw_cap(), draw_diag_edge(), draw_graphics(), draw_margin_lines(), draw_maze_border(), draw_rect_edge(), draw_splitbar(), draw_text_2(), draw_underline(), draw_wall(), CUIFMenuItem::DrawArrow(), SelectionModel::DrawBackgroundPoly(), DrawBackgroundPreview(), CToolSettingsWindow::drawBox(), CUIFMenuItem::DrawCheck(), DrawCheckedRect(), DrawClassicFrame(), DrawClock(), DrawDibBegin(), DrawDibEnd(), DrawFace(), DrawFocusRect(), CGridView::DrawGrid(), DrawHands(), DrawHeaderOrFooter(), DrawIconOnOwnerDrawnButtons(), CUIFButton::DrawIconProc(), DrawLeds(), DrawLines(), DrawMines(), DrawProc(), CardButton::DrawRect(), SelectionModel::DrawSelection(), DrawShadowText(), drawSizeBoxes(), CUIFButton::DrawTextProc(), CUIFBalloonButton::DrawTextProc(), DrawThemeText(), DrawTileBitmap(), DrawXorRect(), dup_bitmap(), EDIT_EM_SetMargins(), EDIT_PaintText(), EDIT_UpdateUniscribeData(), EDIT_UpdateUniscribeData_linedef(), EDIT_WM_Paint(), EDIT_WM_SetFont(), EditDlg_OnInitDialog(), EditGlyphEditWndProc(), EditTypeDlg_OnDrawItem(), Ellp(), EnumEnhMetaFile(), EnumMetaFile(), ExtractOneBitmap(), FILEDLG95_LOOKIN_Init(), Fill(), FillGrid(), FillRect(), find_installed_font(), CTextEditWindow::FixEditPos(), SelectionModel::FlipHorizontally(), SelectionModel::FlipVertically(), fnIMLangFontLink2_GetFontCodePages(), font_height(), FrameRect(), GB_Paint(), GB_ThemedPaint(), GDI32_GdipDrawDriverString(), gdi_get_font_metrics(), GdipAddPathString(), GdipCreateFont(), GdipCreateFontFromLogfontW(), GdipDrawImagePointsRect(), GdipDrawString(), GdipGetDC(), GdipGetImageGraphicsContext(), GdipMeasureCharacterRanges(), GdipMeasureDriverString(), GdipMeasureString(), GdiSelectBrush(), GdiSelectFont(), GdiSelectPen(), GeneralPageProc(), get_bitmap_info(), get_color_format(), get_current_font_height(), get_font_dpi(), get_font_fsselection(), get_font_hfont(), get_glyph_indices(), get_text_metr_size(), get_tmheight(), get_tmheightW(), GetButtonHeight(), CUIFBalloonWindow::GetButtonSize(), ATL::CImage::GetDC(), GetDiaogTextureBrush(), GetFontMetrics(), GetIdealItemHeight(), GetPhysicalFontHeight(), SelectionModel::GetSelectionContents(), getSubImage(), CTipbarThread::GetTextSize(), CUIFButton::GetTextSize(), GetThemeTextExtent(), GetThemeTextMetrics(), CUIFToolTip::GetTipWindowSize(), Ghost_OnDraw(), Graph_DrawCpuUsageGraph(), Graph_DrawMemUsageGraph(), GraphCtrl_AddPoint(), GraphCtrl_Create(), GraphCtrl_RedrawBitmap(), GraphCtrl_RedrawOnHeightChange(), GuiCopyFromGraphicsBuffer(), GuiPaintCaret(), GuiPaintTextModeBuffer(), CTaskSwitchWnd::HandleItemPaint(), HandlePrintPasswdChar(), HEADER_Create(), HEADER_CreateDragImage(), HEADER_DrawItem(), HEADER_Refresh(), HEADER_SetFont(), HelDdSurfLock(), HelDdSurfUnlock(), HEXEDIT_WM_PAINT(), HEXEDIT_WM_SETFONT(), HLPFILE_RtfAddTransparentBitmap(), HOTKEY_DrawHotKey(), HOTKEY_SetFont(), ICONTITLE_Paint(), ICONTITLE_SetTitlePos(), COpenWithMenu::IconToBitmap(), ImageList_Add(), ImageList_AddMasked(), ImageList_Copy(), ImageList_Create(), ImageList_DragMove(), ImageList_DragShowNolock(), ImageList_DrawIndirect(), ImageList_GetIcon(), IMAGELIST_InternalExpandBitmaps(), ImageList_Remove(), ImageList_Replace(), ImageList_ReplaceIcon(), ImageList_SetIconSize(), ImageList_SetImageCount(), ImageModel::ImageModel(), Imm32DrawBitmap(), InatCreateIconBySize(), init(), InitColorButtons(), InitLogo(), InitPerBitDepth(), InitResources(), IntDrawDiagEdge(), IntDrawScrollInterior(), IntDrawState(), IntGetWindowBitmap(), IntGrayString(), SelectionModel::InvertSelection(), is_font_available(), Line(), LISTBOX_DrawFocusRect(), LISTBOX_Paint(), LISTBOX_RepaintItem(), LISTBOX_SetFont(), LISTVIEW_Command(), LISTVIEW_CreateCheckBoxIL(), LISTVIEW_CreateDragImage(), LISTVIEW_EditLabelT(), LISTVIEW_GetItemMetrics(), LISTVIEW_GetStringWidthT(), LISTVIEW_Refresh(), LISTVIEW_RefreshList(), LISTVIEW_RefreshReport(), LISTVIEW_RefreshReportGrid(), LISTVIEW_SaveTextMetrics(), LISTVIEW_SetColumnWidth(), LISTVIEW_ShowFocusRect(), LoadCardBitmapsFromLibrary(), LoadDialog(), LoadIniFile(), ImageModel::LockBitmap(), LPK_DrawUnderscore(), LrgCellWndProc(), MainWndProc(), map_font(), MDI_AugmentFrameMenu(), ME_DebugWrite(), ME_DrawOLE(), ME_DrawParaDecoration(), ME_DrawTableBorders(), CTrayClockWnd::MeasureLines(), menu_ownerdraw_wnd_proc(), mi_line(), mi_paint_rect(), MonSelGetMonitorFont(), MonSelPaint(), MonSelPaintMonitor(), MONTHCAL_Circle(), MONTHCAL_PaintCalendar(), MONTHCAL_PaintTitle(), MONTHCAL_PaintTodayTitle(), MONTHCAL_UpdateSize(), MonthCalPaint(), msi_dialog_get_sans_serif_height(), msi_load_picture(), mstsc_ProtocolIOThread(), MyDrawCaptionTemp(), MyDrawFrameCaption(), MyDrawFrameScroll(), MyDrawMenuBarTemp(), MyIntDrawRectEdge(), NT5_DrawBaseBackground(), NT5_DrawLogoffCaptionText(), NT5_DrawLogoffIcon(), OB_Paint(), OleCreatePropertyFrameIndirect(), OLEFontImpl_QueryTextMetrics(), OleMetafilePictFromIconAndLabel(), OLEPictureImpl_LoadWICSource(), OLEPictureImpl_SelectPicture(), on_wm_initdialog(), CBaseBarSite::OnCustomDraw(), CMenuToolbarBase::OnCustomDraw(), OnDrawItem(), CAutoComplete::OnDrawItem(), OnPaint(), CMiniatureWindow::OnPaint(), CPaletteWindow::OnPaint(), CDownloaderProgress::OnPaint(), CTrayClockWnd::OnPaint(), CBrandBand::OnPaint(), CACSizeBox::OnPaint(), OSK_Paint(), paint_ruler(), PaintBanner(), PaintCells(), PaintControl(), PAINTING_DrawStateJam(), CUIFBalloonWindow::PaintMessageProc(), CAppScrnshotPreview::PaintOnDC(), CDrvDefExt::PaintStaticControls(), PaintText(), parent_wnd_proc(), PathSetDlgItemPathW(), PB_Paint(), PB_ThemedPaint(), PlayEnhMetaFileRecord(), PlayMetaFile(), PlayMetaFileRecord(), PlotCharacter(), plugin_proc(), Poly(), PolygonTest(), PolyPatBlt(), prepare_dc(), CardRegion::PrepareDragBitmaps(), CardRegion::PrepareDragBitmapsThreed(), PressBox(), print_preview(), PRINTDLG_PagePaintProc(), PrintTextXY(), PROPSHEET_Paint(), ImageModel::PushImageForUndo(), putSubImage(), realize_font(), REBAR_DrawBand(), REBAR_DrawChevron(), REBAR_ValidateBand(), Rect(), RectSel(), ImageModel::Redo(), ATL::CImage::ReleaseDC(), render_masked_bitmap(), restore_dc(), RichEditWndProc_common(), RosImageProc(), Rotate90DegreeBlt(), SelectionModel::RotateNTimes90Degrees(), RRect(), SB_OnPaint(), ScreenSaverProc(), ScriptStringAnalyse(), select_style(), CardWindow::SetBackImage(), CUIFBitmapDC::SetBitmap(), CUIFBitmapDC::SetDIB(), SetDIBits(), CGridView::SetFont(), CACListView::SetFont(), SetFont(), SetFontStylesToCombo2(), SetMatrixMessage(), SetSpecialDCState(), SetSpecialDCState2(), SetupControls(), ShowColorSpectrum(), ShowResolutionPreview(), ShowScreenSaverPreview(), SIC_OverlayShortcutImage(), SkewDIB(), SoftModalMessageBox(), SOFTWARE_GdipDrawDriverString(), solid_patblt(), SS_ItemOut(), START_TEST(), STATIC_PaintBitmapfn(), STATIC_PaintOwnerDrawfn(), STATIC_PaintTextfn(), STATUSBAR_Refresh(), StatusDialogProc(), StatusMessageWindowProc(), stretch_blt_icon(), SelectionModel::StretchSkew(), SYSLINK_Draw(), SYSLINK_GetIdealHeight(), SYSLINK_GetIdealSize(), SYSLINK_Render(), T1_DrawConvexRect(), T1_DrawDragBorder(), T1_DrawLabels(), T1_GetTextMetric(), T1_InitBitmap(), T1_OnDraw(), T1_SetData(), TAB_Create(), TAB_DrawItemInterior(), TAB_Refresh(), TAB_SetItemBounds(), taskdialog_get_text_extent(), test_32bit_ddb(), test_alpha_hdc(), test_bcm_get_ideal_size(), test_BitBlt(), Test_Bitmap(), test_bitmap(), test_bitmap_colors(), test_bitmap_font(), test_bitmap_font_glyph_index(), test_bitmap_font_metrics(), test_bitmap_formats(), test_bitmap_rendering(), test_boundsrect(), Test_BrushOrigin(), test_buffered_paint(), Test_bug3481(), test_button_messages(), test_clipping(), test_CreateBitmap(), Test_CreateCompatibleDC(), test_CreateCompatibleDC(), test_createdibitmap(), Test_CreateDIBitmap_CBM_CREATDIB(), Test_CreateDIBitmap_DIB_PAL_COLORS(), Test_CreateDIBPatternBrushPt(), test_createhbitmap(), test_createtext(), test_D3DKMTCreateDCFromMemory(), test_DC_bitmap(), test_dc_layout(), test_device_caps(), test_DIB_PAL_COLORS(), test_dibsections(), test_DrawDib_sizeimage(), test_DrawIcon(), test_DrawIconEx(), test_DrawState(), test_DrawTextCalcRect(), test_east_asian_font_selection(), test_emf_BitBlt(), test_emf_DCBrush(), test_emf_ExtTextOut_on_path(), test_emfonly(), test_ExtTextOut(), test_fake_bold_font(), test_FillRect(), test_font_caps(), Test_FontSelectionEntry(), test_fstype_fixup(), test_fullname(), test_fullname2_helper(), test_gdi_objects(), test_GdiAlphaBlend(), Test_GdiGetCharDimensions(), test_GdiGetCodePage(), test_GdiGradientFill(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetVisibleClipBounds_memoryDC(), test_gditransform(), test_GetCharABCWidths(), test_GetCharWidth32(), test_GetCharWidthI(), Test_GetCurrentObject(), test_GetCurrentObject(), test_GetCursorFrameInfo(), test_getdc(), test_getdc_scaled(), Test_GetDIBColorTable(), test_GetDIBits_selected_DDB(), test_GetDIBits_selected_DIB(), test_GetFontUnicodeRanges(), test_GetGlyphIndices(), test_GetGlyphOutline(), test_GetGlyphOutline_empty_contour(), test_GetGlyphOutline_metric_clipping(), Test_GetIdealSizeNoThemes(), test_GetKerningPairs(), test_GetOutlineTextMetrics(), Test_GetPixel_1bpp(), Test_GetRandomRgn_RGN5(), Test_GetRandomRgn_SYSRGN(), test_GetSetDIBits_rtl(), test_GetTextFace(), Test_GetTextFaceAliasW(), test_GetTextMetrics2(), test_hdc_caching(), test_height(), test_ImageList_DrawIndirect(), Test_IsSpecialState(), test_item_count(), test_layered_window(), test_margins_default(), test_margins_usefontinfo(), Test_MaskBlt_16bpp(), Test_MaskBlt_1bpp(), Test_MaskBlt_32bpp(), Test_MaskBlt_Brush(), test_max_height(), test_memory_dc_clipping(), test_mf_DCBrush(), test_mf_PatternBrush(), test_mf_SaveDC(), test_mono_bitmap(), test_mono_dibsection(), test_negative_width(), test_nonexistent_font(), Test_NtGdiDoPalette_SetDIBColorTable(), test_nullframerect(), test_oemcharset(), test_orientation(), test_outline_font(), Test_PaintRgn(), test_palette_brush(), Test_PatBlt_Params(), test_path_state(), Test_Pen(), test_printer_dc(), test_ps_alternate(), test_RealizationInfo(), Test_Rectangle(), Test_Region(), test_SaveDC(), test_script_cache_reuse(), test_ScriptCacheGetHeight(), test_ScriptGetFontProperties(), test_ScriptGetGlyphABCWidth(), test_ScriptPlace(), test_ScriptShape(), test_ScriptShapeOpenType(), test_select_object(), Test_SelectObject(), Test_SetDCPenColor(), Test_SetDIBits_1bpp(), test_SetDIBitsToDevice(), test_SetDIBitsToDevice_RLE8(), Test_SetPixel_PAL(), test_SetTextJustification(), test_simple_graphics(), Test_SrcMono(), Test_SrcMono1(), test_StretchBlt(), test_StretchBlt_TopDownOptions(), test_StretchDIBits(), test_tab(), test_text_extents(), test_text_metrics(), test_text_position_style(), test_TxGetNaturalSize(), test_widenpath(), Text(), TEXT_DrawUnderscore(), TextProc(), ThemeDrawCaptionText(), ThemeEndBufferedPaint(), ThemeStartBufferedPaint(), TimeZonePageProc(), TOOLBAR_CalcStrings(), TOOLBAR_CustomizeDialogProc(), TOOLBAR_DrawArrow(), TOOLBAR_DrawMasked(), TOOLBAR_DrawPattern(), TOOLBAR_DrawString(), TOOLBAR_LayoutToolbar(), ToolTipProc(), TOOLTIPS_CalcTipSize(), TOOLTIPS_Refresh(), TRACKBAR_DrawTics(), TRACKBAR_FillThumb(), TRACKBAR_Refresh(), TrayIcon_GetProcessorUsageIcon(), TreeListDraw(), TreeListEditLabel(), TREEVIEW_Command(), TREEVIEW_ComputeTextWidth(), TREEVIEW_CreateDragImage(), TREEVIEW_DrawItem(), TREEVIEW_DrawItemLines(), TREEVIEW_EditLabel(), TREEVIEW_InitCheckboxes(), TREEVIEW_NaturalHeight(), TREEVIEW_UpdateSubTree(), UB_Paint(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), UITOOLS95_DrawFrameScroll(), UITOOLS_DrawCheckedRect(), ImageModel::Undo(), CUIFBitmapDC::Uninit(), ImageModel::UnlockBitmap(), UnpressBox(), update_preview(), UpdateButtonColor(), UpdateCaretPos(), UpdateFont(), UserLpkPSMTextOut(), UXTHEME_DrawBorderRectangle(), UXTHEME_DrawImageBackground(), UXTHEME_DrawThemePartToDib(), UXTHEME_SizedBlt(), VfdToolTip(), wglUseFontOutlines_common(), WinMain(), WndProc(), SDIMainFrame::WndProc(), ChildWindow::WndProc(), WndProc_wave(), write_monocolor_span_frontbuffer(), wWinMain(), ZoomWnd_OnDraw(), CDimmedWindow::~CDimmedWindow(), and ImageModel::~ImageModel().

◆ SelectPalette()

HPALETTE WINAPI SelectPalette ( HDC  hdc,
HPALETTE  hpal,
BOOL  bForceBackground 
)

Definition at line 1319 of file dc.c.

1323{
1325 {
1327 {
1328 return (HPALETTE)((ULONG_PTR)METADC_SelectPalette(hdc, hpal));
1329 }
1330 else
1331 {
1332 PLDC pLDC = GdiGetLDC(hdc);
1333 if ( !pLDC )
1334 {
1336 return NULL;
1337 }
1338 if ( pLDC->iType == LDC_EMFLDC && !(EMFDC_SelectPalette(pLDC, hpal)) )
1339 {
1340 return NULL;
1341 }
1342 }
1343 }
1344 return NtUserSelectPalette(hdc, hpal, bForceBackground);
1345}
#define ULONG_PTR
Definition: config.h:101
BOOL EMFDC_SelectPalette(LDC *dc_attr, HPALETTE palette) DECLSPEC_HIDDEN
BOOL METADC_SelectPalette(HDC hdc, HPALETTE palette) DECLSPEC_HIDDEN
Definition: metadc.c:1220
HPALETTE WINAPI NtUserSelectPalette(HDC hDC, HPALETTE hpal, BOOL ForceBackground)
Definition: windc.c:1034

◆ SetArcDirection()

INT WINAPI SetArcDirection ( _In_ HDC  hdc,
_In_ INT  nDirection 
)

Definition at line 367 of file dc.c.

370{
372}
@ GdiGetSetArcDirection
Definition: ntgdityp.h:70
DWORD WINAPI GetAndSetDCDWord(_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
Definition: dc.c:746
#define EMR_SETARCDIRECTION
Definition: wingdi.h:131

◆ SetBkColor()

COLORREF WINAPI SetBkColor ( _In_ HDC  hdc,
_In_ COLORREF  crColor 
)

Definition at line 999 of file dc.c.

1002{
1003 PDC_ATTR pdcattr;
1004 COLORREF crOldColor;
1005
1007
1008 /* Get the DC attribute */
1009 pdcattr = GdiGetDcAttr(hdc);
1010 if (pdcattr == NULL)
1011 {
1013 return CLR_INVALID;
1014 }
1015
1016 /* Get old color and store the new */
1017 crOldColor = pdcattr->ulBackgroundClr;
1018 pdcattr->ulBackgroundClr = crColor;
1019
1020 if (pdcattr->crBackgroundClr != crColor)
1021 {
1023 pdcattr->crBackgroundClr = crColor;
1024 }
1025
1026 return crOldColor;
1027}
#define DIRTY_FILL
Definition: ntgdihdl.h:123
#define DIRTY_LINE
Definition: ntgdihdl.h:124
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:126
COLORREF crBackgroundClr
Definition: ntgdihdl.h:297
DWORD COLORREF
Definition: windef.h:300
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999

Referenced by AboutProc(), ANIMATE_TransparentBlt(), C1_SetData(), CBPaintText(), cd_wndproc(), cdtDrawExt(), CFn_WMDrawItem(), cicChangeBitmapColor(), cicCreateMaskBmp(), COMBOEX_ComboWndProc(), ConfigDlgProc(), SEALED_::ControlWindowProc(), CreateDragImage(), CreateStateImageList(), DefWndControlColor(), RdpClientUI::Display_DrawGlyph(), RdpClientUI::Display_PatBlt(), RdpClientUI::Display_Polygon(), CardButton::Draw(), draw_graphics(), draw_space(), draw_text(), DrawCheckedRect(), DrawShadowText(), EDIT_PaintText(), EditTypeDlg_OnDrawItem(), EnumEnhMetaFile(), FD31_FileOpenDlgProc(), FD31_WMDrawItem(), FILEDLG95_LOOKIN_DrawItem(), FileMenu_DrawItem(), FillSolidRect(), GraphCtrl_Create(), GuiPaintTextModeBuffer(), HEADER_DrawItem(), HLPFILE_RtfAddTransparentBitmap(), HOTKEY_DrawHotKey(), ImageList_AddMasked(), ImageList_DrawIndirect(), InatCreateIconBySize(), IntDrawState(), IntGrayString(), IPADDRESS_Draw(), LISTBOX_PaintItem(), LISTVIEW_DrawFocusRect(), LISTVIEW_Refresh(), MONTHCAL_PaintCalendar(), MONTHCAL_PaintTitle(), MonthCalPaint(), MouseOnCtrlColorStatic(), MyDrawMenuBarTemp(), OLEPictureImpl_LoadWICSource(), OnDrawItem(), OnPaint(), CBrandBand::OnPaint(), PaintControl(), PaintRect(), PaintText(), parent_wnd_proc(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), PlotCharacter(), prepaint_setup(), PROPSHEET_WizardSubclassProc(), REBAR_EraseBkGnd(), render_masked_bitmap(), SetBkColor(), SHFillRectClr(), SS_ItemOut(), START_TEST(), STATIC_PaintBitmapfn(), SYSLINK_Draw(), T1_SetData(), TAB_DrawItem(), TAB_EraseTabInterior(), test_bitmap_colors(), test_dc_values(), test_ExtTextOut(), Test_GetPixel_1bpp(), test_mf_SaveDC(), test_mono_bitmap(), test_SaveDC(), Test_SrcMono1(), test_StretchBlt(), Text(), TOOLBAR_CustomizeDialogProc(), TOOLBAR_DrawButton(), TOOLBAR_DrawFlatHorizontalSeparator(), TOOLBAR_DrawFlatSeparator(), TOOLBAR_DrawMasked(), TOOLBAR_DrawPattern(), TOOLBAR_DrawString(), TRACKBAR_DrawThumb(), TreeListDraw(), TREEVIEW_DrawItem(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS_DrawCheckedRect(), WndProc(), and ZoomWnd_OnDraw().

◆ SetBkMode()

int WINAPI SetBkMode ( _In_ HDC  hdc,
_In_ int  iBkMode 
)

Definition at line 1056 of file dc.c.

1059{
1060 PDC_ATTR pdcattr;
1061 INT iOldMode;
1062
1063 /* Avoid bad mode setting */
1064 if ((iBkMode != TRANSPARENT) && (iBkMode != OPAQUE))
1065 {
1066 DPRINT1("SetBkMode: Incorrect value\n");
1067 return 0;
1068 }
1069
1070 HANDLE_METADC(INT, SetBkMode, 0, hdc, iBkMode);
1071
1072 /* Get the DC attribute */
1073 pdcattr = GdiGetDcAttr(hdc);
1074 if (pdcattr == NULL)
1075 {
1077 return 0;
1078 }
1079
1080 iOldMode = pdcattr->lBkMode;
1081 pdcattr->jBkMode = iBkMode; // Processed
1082 pdcattr->lBkMode = iBkMode; // Raw
1083
1084 return iOldMode;
1085}
BYTE jBkMode
Definition: ntgdihdl.h:308
int WINAPI SetBkMode(_In_ HDC hdc, _In_ int iBkMode)
Definition: dc.c:1056
#define TRANSPARENT
Definition: wingdi.h:950
#define OPAQUE
Definition: wingdi.h:949

Referenced by add_ruler_units(), BUTTON_WindowProc(), ButtonWndProc_common(), CaptWndProc(), CFn_WMPaint(), ConfirmMsgBox_Paint(), CreateLayoutIcon(), CreateStateImageList(), CreateTrayIcon(), DATETIME_Refresh(), default_page_paint_hook(), DlgProc(), draw_graphics(), Pane::draw_item(), draw_text_2(), DrawProc(), DrawShadowText(), DrawStatusTextW(), CUIFButton::DrawTextProc(), CUIFBalloonButton::DrawTextProc(), DrawThemeText(), EDIT_PaintText(), GDI32_GdipDrawDriverString(), HackFillStaticBg(), HEADER_DrawItem(), HEXEDIT_PaintLines(), ICONTITLE_Paint(), LISTVIEW_Refresh(), LogOffDialogProc(), MainWnd_OnDrawItem(), MainWndProc(), ME_PaintContent(), MonSelPaint(), MonthCalPaint(), MSIText_WndProc(), MyDrawCaptionTemp(), MyDrawFrameCaption(), MyDrawFrameScroll(), MyDrawMenuBarTemp(), NT5_DrawLogoffCaptionText(), CTrayWindow::OnCtlColorBtn(), CCanvasWindow::OnCtlColorEdit(), OnCtlColorStatic(), CMenuToolbarBase::OnCustomDraw(), OnDrawItem(), CFontsDialog::OnDrawItem(), CAutoComplete::OnDrawItem(), OnPaint(), CTrayClockWnd::OnPaint(), CUIFBalloonWindow::PaintMessageProc(), PB_Paint(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), prepaint_setup(), ProgressDlg::ProcessWindowMessage(), PROPSHEET_Paint(), RealDrawFrameControl(), REBAR_DrawBand(), RosImageProc(), SetBkMode(), SetupControls(), ShutdownDialogProc(), SS_ItemOut(), START_TEST(), SubclassButtonProc(), SYSLINK_Draw(), TAB_DrawItemInterior(), TabDlgProc(), test_ExtTextOut(), test_ps_alternate(), Test_SrcMono1(), Text(), ThemeDlgPostWindowProc(), TOOLBAR_DrawButton(), TOOLBAR_DrawString(), ToolTipProc(), TOOLTIPS_Refresh(), TreeListDraw(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameScroll(), WndProc(), ColorStatic::WndProc(), and HyperlinkCtrl::WndProc().

◆ SetBoundsRect()

UINT WINAPI SetBoundsRect ( HDC  hdc,
CONST RECT prc,
UINT  flags 
)

Definition at line 836 of file dc.c.

839{
840 /* FIXME add check for validate the flags */
842}
__kernel_entry W32KAPI DWORD APIENTRY NtGdiSetBoundsRect(_In_ HDC hdc, _In_ LPRECT prc, _In_ DWORD f)
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ SetDCBrushColor()

COLORREF WINAPI SetDCBrushColor ( _In_ HDC  hdc,
_In_ COLORREF  crColor 
)

Definition at line 905 of file dc.c.

908{
909 PDC_ATTR pdcattr;
910 COLORREF crOldColor;
911
912 /* Get the DC attribute */
913 pdcattr = GdiGetDcAttr(hdc);
914 if (pdcattr == NULL)
915 {
917 return CLR_INVALID;
918 }
919
920 /* We handle only enhanced meta DCs here */
922
923 /* Get old color and store the new */
924 crOldColor = pdcattr->ulBrushClr;
925 pdcattr->ulBrushClr = crColor;
926
927 if (pdcattr->crBrushClr != crColor)
928 {
929 pdcattr->ulDirty_ |= DIRTY_FILL;
930 pdcattr->crBrushClr = crColor;
931 }
932
933 return crOldColor;
934}
#define HANDLE_EMETAFDC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:644
COLORREF crBrushClr
Definition: ntgdihdl.h:301
COLORREF WINAPI SetDCBrushColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:905

Referenced by CreateLayoutIcon(), CreateTrayIcon(), SelectionModel::DrawBackgroundPoly(), init_function_pointers(), IntDrawDiagEdge(), SetDCBrushColor(), SetSpecialDCState(), SetSpecialDCState2(), and Test_NtGdiDoPalette_SetDIBColorTable().

◆ SetDCPenColor()

COLORREF WINAPI SetDCPenColor ( _In_ HDC  hdc,
_In_ COLORREF  crColor 
)

Definition at line 941 of file dc.c.

944{
945 PDC_ATTR pdcattr;
946 COLORREF crOldColor;
947
948 /* Get the DC attribute */
949 pdcattr = GdiGetDcAttr(hdc);
950 if (pdcattr == NULL)
951 {
953 return CLR_INVALID;
954 }
955
956 /* We handle only enhanced meta DCs here */
958
959 /* Get old color and store the new */
960 crOldColor = pdcattr->ulPenClr;
961 pdcattr->ulPenClr = (ULONG)crColor;
962
963 if (pdcattr->crPenClr != crColor)
964 {
965 pdcattr->ulDirty_ |= DIRTY_LINE;
966 pdcattr->crPenClr = crColor;
967 }
968
969 return crOldColor;
970}
COLORREF crPenClr
Definition: ntgdihdl.h:303
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:941

Referenced by Child_OnPaint(), init_function_pointers(), IntDrawDiagEdge(), MyIntDrawRectEdge(), PB_Paint(), SetDCPenColor(), SetSpecialDCState(), SetSpecialDCState2(), Test_CreateCompatibleDC(), Test_NtGdiDoPalette_SetDIBColorTable(), and Test_SetDCPenColor().

◆ SetGraphicsMode()

int WINAPI SetGraphicsMode ( _In_ HDC  hdc,
_In_ int  iMode 
)

Definition at line 1233 of file dc.c.

1236{
1237 INT iOldMode;
1238 PDC_ATTR pdcattr;
1239
1240 /* Check parameters */
1241 if ((iMode < GM_COMPATIBLE) || (iMode > GM_ADVANCED))
1242 {
1244 return 0;
1245 }
1246
1247 /* Get the DC attribute */
1248 pdcattr = GdiGetDcAttr(hdc);
1249 if (pdcattr == NULL)
1250 {
1252 return 0;
1253 }
1254
1255 /* Check for trivial case */
1256 if (iMode == pdcattr->iGraphicsMode)
1257 return iMode;
1258
1259 if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
1260 {
1261 if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
1262 {
1263 NtGdiFlush(); // Sync up pdcattr from Kernel space.
1264 pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
1265 }
1266 }
1267
1268 /* One would think that setting the graphics mode to GM_COMPATIBLE
1269 * would also reset the world transformation matrix to the unity
1270 * matrix. However, in Windows, this is not the case. This doesn't
1271 * make a lot of sense to me, but that's the way it is.
1272 */
1273 iOldMode = pdcattr->iGraphicsMode;
1274 pdcattr->iGraphicsMode = iMode;
1275
1276 return iOldMode;
1277}
#define NtCurrentTeb
__kernel_entry W32KAPI NTSTATUS APIENTRY NtGdiFlush(VOID)
Definition: gdibatch.c:471
#define DC_MODE_DIRTY
Definition: ntgdihdl.h:144
_In_ ULONG iMode
Definition: winddi.h:3520
#define GM_COMPATIBLE
Definition: wingdi.h:864
#define GM_ADVANCED
Definition: wingdi.h:865

Referenced by DoTestEntry(), EnumEnhMetaFile(), gdi_transform_acquire(), METAFILE_PlaybackUpdateGdiTransform(), PlayEnhMetaFileRecord(), SetSpecialDCState(), SetSpecialDCState2(), START_TEST(), test_ellipse(), test_emf_BitBlt(), test_emf_WorldTransform(), test_ExtTextOutScale(), test_GetCharABCWidths(), test_GetCharWidth32(), test_gettransform(), test_modify_world_transform(), test_outline_font(), Test_PaintRgn(), Test_Rectangle(), test_rectangle(), test_roundrect(), Test_SetWorldTransform(), and test_world_transform().

◆ SetPolyFillMode()

int WINAPI SetPolyFillMode ( _In_ HDC  hdc,
_In_ int  iPolyFillMode 
)

Definition at line 1174 of file dc.c.

1177{
1178 INT iOldPolyFillMode;
1179 PDC_ATTR pdcattr;
1180
1181 HANDLE_METADC(INT, SetPolyFillMode, 0, hdc, iPolyFillMode);
1182
1183 /* Get the DC attribute */
1184 pdcattr = GdiGetDcAttr(hdc);
1185 if (pdcattr == NULL)
1186 {
1188 return 0;
1189 }
1190
1191 if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
1192 {
1193 if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
1194 {
1195 NtGdiFlush(); // Sync up pdcattr from Kernel space.
1196 pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
1197 }
1198 }
1199
1200 iOldPolyFillMode = pdcattr->lFillMode;
1201 pdcattr->lFillMode = iPolyFillMode;
1202
1203 return iOldPolyFillMode;
1204}
int WINAPI SetPolyFillMode(_In_ HDC hdc, _In_ int iPolyFillMode)
Definition: dc.c:1174

Referenced by RdpClientUI::Display_Polygon(), EnumEnhMetaFile(), GDI32_GdipFillPath(), get_path_hrgn(), InitColorButtons(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), PolygonTest(), SetPolyFillMode(), test_ExtTextOut(), test_mf_SaveDC(), test_SaveDC(), and TRACKBAR_FillThumb().

◆ SetRelAbs()

INT WINAPI SetRelAbs ( HDC  hdc,
INT  Mode 
)

Definition at line 733 of file dc.c.

736{
738}
_In_ ULONG Mode
Definition: hubbusif.h:303
@ GdiGetSetRelAbs
Definition: ntgdityp.h:65
#define META_SETRELABS
Definition: wingdi.h:214

Referenced by init_function_pointers(), and PlayMetaFileRecord().

◆ SetROP2()

int WINAPI SetROP2 ( _In_ HDC  hdc,
_In_ int  rop2 
)

Definition at line 1114 of file dc.c.

1117{
1118 PDC_ATTR pdcattr;
1119 INT rop2Old;
1120
1121 HANDLE_METADC(INT, SetROP2, 0, hdc, rop2);
1122
1123 /* Get the DC attribute */
1124 pdcattr = GdiGetDcAttr(hdc);
1125 if (pdcattr == NULL)
1126 {
1128 return 0;
1129 }
1130
1131 if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
1132 {
1133 if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
1134 {
1135 NtGdiFlush();
1136 pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
1137 }
1138 }
1139
1140 rop2Old = pdcattr->jROP2;
1141 pdcattr->jROP2 = (BYTE)rop2;
1142
1143 return rop2Old;
1144}
int WINAPI SetROP2(_In_ HDC hdc, _In_ int rop2)
Definition: dc.c:1114
unsigned char BYTE
Definition: xxhash.c:193

Referenced by RdpClientUI::Display_Line(), RdpClientUI::Display_Polyline(), draw_graphics(), DrawXorRect(), EnumEnhMetaFile(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), Poly(), RectSel(), SetROP2(), test_dc_attributes(), test_destroyed_window(), and test_ExtTextOut().

◆ SetStretchBltMode()

int WINAPI SetStretchBltMode ( _In_ HDC  hdc,
_In_ int  iStretchMode 
)

Definition at line 1373 of file dc.c.

1376{
1377 INT iOldMode;
1378 PDC_ATTR pdcattr;
1379
1380 HANDLE_METADC(INT, SetStretchBltMode, 0, hdc, iStretchMode);
1381
1382 /* Get the DC attribute */
1383 pdcattr = GdiGetDcAttr(hdc);
1384 if (pdcattr == NULL)
1385 {
1387 return 0;
1388 }
1389
1390 iOldMode = pdcattr->lStretchBltMode;
1391 pdcattr->lStretchBltMode = iStretchMode;
1392
1393 // Wine returns an error here. We set the default.
1394 if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode = WHITEONBLACK;
1395
1396 pdcattr->jStretchBltMode = iStretchMode;
1397
1398 return iOldMode;
1399}
BYTE jStretchBltMode
Definition: ntgdihdl.h:310
int WINAPI SetStretchBltMode(_In_ HDC hdc, _In_ int iStretchMode)
Definition: dc.c:1373
#define WHITEONBLACK
Definition: wingdi.h:953
#define MAXSTRETCHBLTMODE
Definition: wingdi.h:956

Referenced by RdpClientUI::DisplayWindowProc(), DrawBackgroundPreview(), EnumEnhMetaFile(), MainWndProc(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), SetStretchBltMode(), test_ExtTextOut(), UXTHEME_StretchBlt(), and WinGStretchBlt().