1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS System Libraries 4 * FILE: win32ss/gdi/gdi32/include/gdi32p.h 5 * PURPOSE: User-Mode Win32 GDI Library Private Header 6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net) 7 */ 8 9 #pragma once 10 11 /* DATA **********************************************************************/ 12 13 extern PGDI_TABLE_ENTRY GdiHandleTable; 14 extern PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable; 15 extern HANDLE hProcessHeap; 16 extern HANDLE CurrentProcessId; 17 extern DWORD GDI_BatchLimit; 18 extern PDEVCAPS GdiDevCaps; 19 extern BOOL gbLpk; // Global bool LanguagePack 20 extern HANDLE ghSpooler; 21 extern RTL_CRITICAL_SECTION semLocal; 22 23 typedef INT 24 (CALLBACK* EMFPLAYPROC)( 25 HDC hdc, 26 INT iFunction, 27 HANDLE hPageQuery 28 ); 29 30 typedef BOOL 31 (WINAPI* LPKETO)( 32 HDC hdc, 33 int x, 34 int y, 35 UINT fuOptions, 36 const RECT *lprc, 37 LPCWSTR lpString, 38 UINT uCount, 39 const INT *lpDx, 40 INT unknown 41 ); 42 43 typedef DWORD 44 (WINAPI* LPKGCP)( 45 HDC hdc, 46 LPCWSTR lpString, 47 INT uCount, 48 INT nMaxExtent, 49 LPGCP_RESULTSW lpResults, 50 DWORD dwFlags, 51 DWORD dwUnused 52 ); 53 54 extern HINSTANCE hLpk; 55 extern LPKETO LpkExtTextOut; 56 extern LPKGCP LpkGetCharacterPlacement; 57 58 /* DEFINES *******************************************************************/ 59 60 #define HANDLE_LIST_INC 20 61 62 #define METAFILE_MEMORY 1 63 #define METAFILE_DISK 2 64 65 #define SAPCALLBACKDELAY 244 66 67 #define LPK_ETO 1 68 #define LPK_GCP 2 69 70 /* MACRO ********************************************************************/ 71 72 #define ROP_USES_SOURCE(Rop) (((Rop) << 2 ^ Rop) & 0xCC0000) 73 #define RCAST(_Type, _Value) (*((_Type*)&_Value)) 74 75 76 /* TYPES *********************************************************************/ 77 78 // Based on wmfapi.h and Wine. 79 typedef struct tagMETAFILEDC 80 { 81 PVOID pvMetaBuffer; 82 HANDLE hFile; 83 DWORD Size; 84 DWORD dwWritten; 85 METAHEADER mh; 86 WORD reserved; 87 HLOCAL MFObjList; 88 HPEN hPen; 89 HBRUSH hBrush; 90 HDC hDc; 91 HGDIOBJ hMetaDc; 92 HPALETTE hPalette; 93 HFONT hFont; 94 HBITMAP hBitmap; 95 HRGN hRegion; 96 HGDIOBJ hMetafile; 97 HGDIOBJ hMemDc; 98 HPEN hExtPen; 99 HGDIOBJ hEnhMetaDc; 100 HGDIOBJ hEnhMetaFile; 101 HCOLORSPACE hColorSpace; 102 WCHAR Filename[MAX_PATH+2]; 103 } METAFILEDC,*PMETAFILEDC; 104 105 // Metafile Entry handle 106 typedef struct tagMF_ENTRY 107 { 108 LIST_ENTRY List; 109 HGDIOBJ hmDC; // Handle return from NtGdiCreateClientObj. 110 PMETAFILEDC pmfDC; 111 } MF_ENTRY, *PMF_ENTRY; 112 113 typedef struct tagENHMETAFILE 114 { 115 PVOID pvMetaBuffer; 116 HANDLE hFile; /* Handle for disk based MetaFile */ 117 DWORD Size; 118 INT iType; 119 PENHMETAHEADER emf; 120 UINT handles_size, cur_handles; 121 HGDIOBJ *handles; 122 INT horzres, vertres; 123 INT horzsize, vertsize; 124 INT logpixelsx, logpixelsy; 125 INT bitspixel; 126 INT textcaps; 127 INT rastercaps; 128 INT technology; 129 INT planes; 130 } ENHMETAFILE,*PENHMETAFILE; 131 132 133 #define PDEV_UMPD_ID 0xFEDCBA98 134 // UMPDEV flags 135 #define UMPDEV_NO_ESCAPE 0x0002 136 #define UMPDEV_SUPPORT_ESCAPE 0x0004 137 typedef struct _UMPDEV 138 { 139 DWORD Sig; // Init with PDEV_UMPD_ID 140 struct _UMPDEV *pumpdNext; 141 PDRIVER_INFO_5W pdi5Info; 142 HMODULE hModule; 143 DWORD dwFlags; 144 DWORD dwDriverAttributes; 145 DWORD dwConfigVersion; // Number of times the configuration 146 // file for this driver has been upgraded 147 // or downgraded since the last spooler restart. 148 DWORD dwDriverCount; // After init should be 2 149 DWORD WOW64_UMPDev; 150 DWORD WOW64_hMod; 151 DWORD Unknown; 152 PVOID apfn[INDEX_LAST]; // Print Driver pfn 153 } UMPDEV, *PUMPDEV; 154 155 #define LOCALFONT_COUNT 10 156 typedef struct _LOCALFONT 157 { 158 FONT_ATTR lfa[LOCALFONT_COUNT]; 159 } LOCALFONT, *PLOCALFONT; 160 161 // sdk/winspool.h 162 typedef BOOL (WINAPI *ABORTPRINTER) (HANDLE); 163 typedef BOOL (WINAPI *CLOSEPRINTER) (HANDLE); 164 typedef BOOL (WINAPI *CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE); // W2k8 165 typedef HANDLE (WINAPI *COMMITSPOOLDATA) (HANDLE,HANDLE,DWORD); // W2k8 166 typedef LONG (WINAPI *DOCUMENTPROPERTIESW) (HWND,HANDLE,LPWSTR,PDEVMODEW,PDEVMODEW,DWORD); 167 typedef BOOL (WINAPI *ENDDOCPRINTER) (HANDLE); 168 typedef BOOL (WINAPI *ENDPAGEPRINTER) (HANDLE); 169 typedef BOOL (WINAPI *GETPRINTERW) (HANDLE,DWORD,LPBYTE,DWORD,LPDWORD); 170 typedef BOOL (WINAPI *GETPRINTERDRIVERW) (HANDLE,LPWSTR,DWORD,LPBYTE,DWORD,LPDWORD); 171 typedef HANDLE (WINAPI *GETSPOOLFILEHANDLE) (HANDLE); // W2k8 172 typedef BOOL (WINAPI *ISVALIDDEVMODEW) (PDEVMODEW,size_t); 173 typedef BOOL (WINAPI *OPENPRINTERW) (LPWSTR,PHANDLE,LPPRINTER_DEFAULTSW); 174 typedef BOOL (WINAPI *READPRINTER) (HANDLE,PVOID,DWORD,PDWORD); 175 typedef BOOL (WINAPI *RESETPRINTERW) (HANDLE,LPPRINTER_DEFAULTSW); 176 typedef LPWSTR (WINAPI *STARTDOCDLGW) (HANDLE,DOCINFOW *); 177 typedef DWORD (WINAPI *STARTDOCPRINTERW) (HANDLE,DWORD,PBYTE); 178 typedef BOOL (WINAPI *STARTPAGEPRINTER) (HANDLE); 179 // ddk/winsplp.h 180 typedef BOOL (WINAPI *SEEKPRINTER) (HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD,BOOL); 181 typedef BOOL (WINAPI *SPLREADPRINTER) (HANDLE,LPBYTE *,DWORD); 182 // Same as ddk/winsplp.h DriverUnloadComplete? 183 typedef BOOL (WINAPI *SPLDRIVERUNLOADCOMPLETE) (LPWSTR); 184 // Driver support: 185 // DrvDocumentEvent api/winddiui.h not W2k8 DocumentEventAW 186 typedef INT (WINAPI *DOCUMENTEVENT) (HANDLE,HDC,INT,ULONG,PVOID,ULONG,PVOID); 187 // DrvQueryColorProfile 188 typedef BOOL (WINAPI *QUERYCOLORPROFILE) (HANDLE,PDEVMODEW,ULONG,VOID*,ULONG,FLONG); 189 // Unknown: 190 typedef DWORD (WINAPI *QUERYSPOOLMODE) (HANDLE,DWORD,DWORD); 191 typedef DWORD (WINAPI *QUERYREMOTEFONTS) (DWORD,DWORD,DWORD); 192 193 extern CLOSEPRINTER fpClosePrinter; 194 extern OPENPRINTERW fpOpenPrinterW; 195 196 /* FUNCTIONS *****************************************************************/ 197 198 PVOID 199 HEAP_alloc(DWORD len); 200 201 NTSTATUS 202 HEAP_strdupA2W( 203 LPWSTR* ppszW, 204 LPCSTR lpszA 205 ); 206 207 VOID 208 HEAP_free(LPVOID memory); 209 210 VOID 211 FASTCALL 212 FONT_TextMetricWToA( 213 const TEXTMETRICW *ptmW, 214 LPTEXTMETRICA ptmA 215 ); 216 217 VOID 218 FASTCALL 219 NewTextMetricW2A( 220 NEWTEXTMETRICA *tma, 221 NEWTEXTMETRICW *tmw 222 ); 223 224 VOID 225 FASTCALL 226 NewTextMetricExW2A( 227 NEWTEXTMETRICEXA *tma, 228 NEWTEXTMETRICEXW *tmw 229 ); 230 231 BOOL 232 FASTCALL 233 DeleteRegion( HRGN ); 234 235 BOOL 236 WINAPI 237 GdiValidateHandle(HGDIOBJ); 238 239 BOOL 240 GdiGetHandleUserData( 241 HGDIOBJ hGdiObj, 242 DWORD ObjectType, 243 PVOID *UserData 244 ); 245 246 PLDC 247 FASTCALL 248 GdiGetLDC(HDC hDC); 249 250 BOOL 251 FASTCALL 252 GdiSetLDC(HDC hdc, PVOID pvLDC); 253 254 HGDIOBJ 255 WINAPI 256 GdiFixUpHandle(HGDIOBJ hGO); 257 258 BOOL 259 WINAPI 260 CalculateColorTableSize( 261 CONST BITMAPINFOHEADER *BitmapInfoHeader, 262 UINT *ColorSpec, 263 UINT *ColorTableSize 264 ); 265 266 LPBITMAPINFO 267 WINAPI 268 ConvertBitmapInfo( 269 CONST BITMAPINFO *BitmapInfo, 270 UINT ColorSpec, 271 UINT *BitmapInfoSize, 272 BOOL FollowedByData 273 ); 274 275 DWORD 276 WINAPI 277 GetAndSetDCDWord( 278 _In_ HDC hdc, 279 _In_ UINT u, 280 _In_ DWORD dwIn, 281 _In_ ULONG ulMFId, 282 _In_ USHORT usMF16Id, 283 _In_ DWORD dwError); 284 285 DWORD 286 WINAPI 287 GetDCDWord( 288 _In_ HDC hdc, 289 _In_ UINT u, 290 _In_ DWORD dwError); 291 292 HGDIOBJ 293 WINAPI 294 GetDCObject( HDC, INT); 295 296 VOID 297 NTAPI 298 LogFontA2W( 299 LPLOGFONTW pW, 300 CONST LOGFONTA *pA 301 ); 302 303 VOID 304 NTAPI 305 LogFontW2A( 306 LPLOGFONTA pA, 307 CONST LOGFONTW *pW 308 ); 309 310 VOID 311 WINAPI 312 EnumLogFontExW2A( 313 LPENUMLOGFONTEXA fontA, 314 CONST ENUMLOGFONTEXW *fontW ); 315 316 BOOL 317 WINAPI 318 LoadLPK( 319 INT LpkFunctionID 320 ); 321 322 BOOL 323 WINAPI 324 GetETM(HDC hdc, 325 EXTTEXTMETRIC *petm); 326 327 /* FIXME: Put in some public header */ 328 UINT 329 WINAPI 330 UserRealizePalette(HDC hDC); 331 332 int 333 WINAPI 334 GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv); 335 336 VOID 337 WINAPI 338 GdiSetLastError( DWORD dwErrCode ); 339 340 DWORD WINAPI GdiGetCodePage(HDC); 341 342 int 343 WINAPI 344 GdiGetBitmapBitsSize(BITMAPINFO *lpbmi); 345 346 VOID GdiSAPCallback(PLDC pldc); 347 HGDIOBJ FASTCALL hGetPEBHandle(HANDLECACHETYPE,COLORREF); 348 349 int FASTCALL DocumentEventEx(PVOID,HANDLE,HDC,int,ULONG,PVOID,ULONG,PVOID); 350 BOOL FASTCALL EndPagePrinterEx(PVOID,HANDLE); 351 BOOL FASTCALL LoadTheSpoolerDrv(VOID); 352 353 FORCEINLINE 354 PVOID 355 GdiAllocBatchCommand( 356 HDC hdc, 357 USHORT Cmd) 358 { 359 PTEB pTeb; 360 USHORT cjSize; 361 PGDIBATCHHDR pHdr; 362 363 /* Get a pointer to the TEB */ 364 pTeb = NtCurrentTeb(); 365 366 /* Check if we have a valid environment */ 367 if (!pTeb || !pTeb->Win32ThreadInfo) return NULL; 368 369 /* Do we use a DC? */ 370 if (hdc) 371 { 372 /* If the batch DC is NULL, we set this one as the new one */ 373 if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc; 374 375 /* If not, check if the batch DC equal to our DC */ 376 else if (pTeb->GdiTebBatch.HDC != hdc) return NULL; 377 } 378 379 /* Get the size of the entry */ 380 if (Cmd == GdiBCPatBlt) cjSize = 0; 381 else if (Cmd == GdiBCPolyPatBlt) cjSize = 0; 382 else if (Cmd == GdiBCTextOut) cjSize = 0; 383 else if (Cmd == GdiBCExtTextOut) cjSize = 0; 384 else if (Cmd == GdiBCSetBrushOrg) cjSize = sizeof(GDIBSSETBRHORG); 385 else if (Cmd == GdiBCExtSelClipRgn) cjSize = 0; 386 else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT); 387 else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT); 388 else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT); 389 else cjSize = 0; 390 391 /* Unsupported operation */ 392 if (cjSize == 0) return NULL; 393 394 /* Check if the buffer is full */ 395 if ((pTeb->GdiBatchCount >= GDI_BatchLimit) || 396 ((pTeb->GdiTebBatch.Offset + cjSize) > GDIBATCHBUFSIZE)) 397 { 398 /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush 399 the current batch */ 400 NtGdiFlush(); 401 } 402 403 /* Get the head of the entry */ 404 pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset); 405 406 /* Update Offset and batch count */ 407 pTeb->GdiTebBatch.Offset += cjSize; 408 pTeb->GdiBatchCount++; 409 410 /* Fill in the core fields */ 411 pHdr->Cmd = Cmd; 412 pHdr->Size = cjSize; 413 414 return pHdr; 415 } 416 417 FORCEINLINE 418 PDC_ATTR 419 GdiGetDcAttr(HDC hdc) 420 { 421 GDILOOBJTYPE eDcObjType; 422 PDC_ATTR pdcattr; 423 424 /* Check DC object type */ 425 eDcObjType = GDI_HANDLE_GET_TYPE(hdc); 426 if ((eDcObjType != GDILoObjType_LO_DC_TYPE) && 427 (eDcObjType != GDILoObjType_LO_ALTDC_TYPE)) 428 { 429 return NULL; 430 } 431 432 /* Get the DC attribute */ 433 if (!GdiGetHandleUserData((HGDIOBJ)hdc, eDcObjType, (PVOID*)&pdcattr)) 434 { 435 return NULL; 436 } 437 438 return pdcattr; 439 } 440 441 FORCEINLINE 442 PRGN_ATTR 443 GdiGetRgnAttr(HRGN hrgn) 444 { 445 PRGN_ATTR prgnattr; 446 447 /* Get the region attribute */ 448 if (!GdiGetHandleUserData(hrgn, GDILoObjType_LO_REGION_TYPE, (PVOID*)&prgnattr)) 449 { 450 return NULL; 451 } 452 453 return prgnattr; 454 } 455 456 #ifdef _M_IX86 457 FLOATL FASTCALL EFtoF(EFLOAT_S * efp); 458 #define FOtoF(pfo) EFtoF((EFLOAT_S*)pfo) 459 #else 460 #define FOtoF(pfo) (*(pfo)) 461 #endif 462 463 /* This is an inlined version of lrintf. */ 464 FORCEINLINE 465 int 466 _lrintf(float f) 467 { 468 #if defined(_M_IX86) && defined(__GNUC__) 469 int result; 470 __asm__ __volatile__ ("fistpl %0" : "=m" (result) : "t" (f) : "st"); 471 return result; 472 #elif defined(_M_IX86) && defined(_MSC_VER) 473 int result; 474 __asm 475 { 476 fld f; 477 fistp result; 478 } 479 #else 480 /* slow, but portable */ 481 return (int)(f >= 0 ? f+0.5 : f-0.5); 482 #endif 483 } 484 485 HBRUSH 486 WINAPI 487 GdiSelectBrush( 488 _In_ HDC hdc, 489 _In_ HBRUSH hbr); 490 491 HPEN 492 WINAPI 493 GdiSelectPen( 494 _In_ HDC hdc, 495 _In_ HPEN hpen); 496 497 HFONT 498 WINAPI 499 GdiSelectFont( 500 _In_ HDC hdc, 501 _In_ HFONT hfont); 502 503 HGDIOBJ 504 WINAPI 505 GdiCreateClientObj( 506 _In_ PVOID pvObject, 507 _In_ GDILOOBJTYPE eObjType); 508 509 PVOID 510 WINAPI 511 GdiDeleteClientObj( 512 _In_ HGDIOBJ hobj); 513 514 BOOL 515 WINAPI 516 GdiCreateClientObjLink( 517 _In_ HGDIOBJ hobj, 518 _In_ PVOID pvObject); 519 520 PVOID 521 WINAPI 522 GdiGetClientObjLink( 523 _In_ HGDIOBJ hobj); 524 525 PVOID 526 WINAPI 527 GdiRemoveClientObjLink( 528 _In_ HGDIOBJ hobj); 529 530 extern ULONG gcClientObj; 531 532 VOID 533 WINAPI 534 METADC_DeleteObject(HGDIOBJ hobj); 535 536 BOOL 537 WINAPI 538 METADC_DeleteDC( 539 _In_ HDC hdc); 540 541 INT 542 WINAPI 543 METADC16_Escape( 544 _In_ HDC hdc, 545 _In_ INT nEscape, 546 _In_ INT cbInput, 547 _In_ LPCSTR lpvInData, 548 _Out_ LPVOID lpvOutData); 549 550 BOOL 551 WINAPI 552 METADC_ExtTextOutW( 553 HDC hdc, 554 INT x, 555 INT y, 556 UINT fuOptions, 557 const RECT *lprc, 558 LPCWSTR lpString, 559 UINT cchString, 560 const INT *lpDx); 561 562 BOOL 563 WINAPI 564 METADC_PatBlt( 565 _In_ HDC hdc, 566 _In_ INT xLeft, 567 _In_ INT yTop, 568 _In_ INT nWidth, 569 _In_ INT nHeight, 570 _In_ DWORD dwRop); 571 572 573 /* The following METADC_* functions follow this pattern: */ 574 #define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...) \ 575 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \ 576 { \ 577 DWORD_PTR dwResult; \ 578 if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc)) \ 579 { \ 580 return (_RetType)dwResult; \ 581 } \ 582 } 583 584 #define HANDLE_METADC(_RetType, _Func, dwError, hdc, ...) \ 585 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \ 586 { \ 587 DWORD_PTR dwResult = 1; \ 588 if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc, __VA_ARGS__)) \ 589 { \ 590 return (_RetType)dwResult; \ 591 } \ 592 } 593 594 595 typedef enum _DCFUNC 596 { 597 //DCFUNC_AbortDoc, 598 DCFUNC_AbortPath, 599 DCFUNC_AlphaBlend, // UNIMPLEMENTED 600 DCFUNC_AngleArc, // UNIMPLEMENTED 601 DCFUNC_Arc, 602 DCFUNC_ArcTo, // UNIMPLEMENTED 603 DCFUNC_BeginPath, 604 //DCFUNC_BitBlt, 605 DCFUNC_Chord, 606 DCFUNC_CloseFigure, 607 DCFUNC_Ellipse, 608 DCFUNC_EndPath, 609 DCFUNC_ExcludeClipRect, 610 DCFUNC_ExtEscape, 611 DCFUNC_ExtFloodFill, 612 DCFUNC_ExtSelectClipRgn, 613 DCFUNC_ExtTextOut, 614 DCFUNC_FillPath, 615 DCFUNC_FillRgn, 616 DCFUNC_FlattenPath, 617 DCFUNC_FrameRgn, 618 DCFUNC_GetDeviceCaps, 619 DCFUNC_GdiComment, 620 DCFUNC_GradientFill, // UNIMPLEMENTED 621 DCFUNC_IntersectClipRect, 622 DCFUNC_InvertRgn, 623 DCFUNC_LineTo, 624 DCFUNC_MaskBlt, // UNIMPLEMENTED 625 DCFUNC_ModifyWorldTransform, 626 DCFUNC_MoveTo, 627 DCFUNC_OffsetClipRgn, 628 DCFUNC_OffsetViewportOrgEx, 629 DCFUNC_OffsetWindowOrgEx, 630 DCFUNC_PathToRegion, // UNIMPLEMENTED 631 DCFUNC_PatBlt, 632 DCFUNC_Pie, 633 DCFUNC_PlgBlt, // UNIMPLEMENTED 634 DCFUNC_PolyBezier, 635 DCFUNC_PolyBezierTo, 636 DCFUNC_PolyDraw, 637 DCFUNC_Polygon, 638 DCFUNC_Polyline, 639 DCFUNC_PolylineTo, 640 DCFUNC_PolyPolygon, 641 DCFUNC_PolyPolyline, 642 DCFUNC_RealizePalette, 643 DCFUNC_Rectangle, 644 DCFUNC_RestoreDC, 645 DCFUNC_RoundRect, 646 DCFUNC_SaveDC, 647 DCFUNC_ScaleViewportExtEx, 648 DCFUNC_ScaleWindowExtEx, 649 DCFUNC_SelectBrush, 650 DCFUNC_SelectClipPath, 651 DCFUNC_SelectFont, 652 DCFUNC_SelectPalette, 653 DCFUNC_SelectPen, 654 DCFUNC_SetDCBrushColor, 655 DCFUNC_SetDCPenColor, 656 DCFUNC_SetDIBitsToDevice, 657 DCFUNC_SetBkColor, 658 DCFUNC_SetBkMode, 659 DCFUNC_SetLayout, 660 //DCFUNC_SetMapMode, 661 DCFUNC_SetPixel, 662 DCFUNC_SetPolyFillMode, 663 DCFUNC_SetROP2, 664 DCFUNC_SetStretchBltMode, 665 DCFUNC_SetTextAlign, 666 DCFUNC_SetTextCharacterExtra, 667 DCFUNC_SetTextColor, 668 DCFUNC_SetTextJustification, 669 DCFUNC_SetViewportExtEx, 670 DCFUNC_SetViewportOrgEx, 671 DCFUNC_SetWindowExtEx, 672 DCFUNC_SetWindowOrgEx, 673 DCFUNC_SetWorldTransform, 674 DCFUNC_StretchBlt, 675 DCFUNC_StrokeAndFillPath, 676 DCFUNC_StrokePath, 677 DCFUNC_TransparentBlt, // UNIMPLEMENTED 678 DCFUNC_WidenPath, 679 680 } DCFUNC; 681 682 BOOL 683 METADC_Dispatch( 684 _In_ DCFUNC eFunction, 685 _Out_ PDWORD_PTR pdwResult, 686 _In_ DWORD_PTR dwError, 687 _In_ HDC hdc, 688 ...); 689 690 #define HANDLE_METADC2(_RetType, _Func, hdc, ...) \ 691 if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \ 692 { \ 693 _RetType result; \ 694 if (METADC_##_Func(&result, hdc, __VA_ARGS__)) \ 695 { \ 696 return result; \ 697 } \ 698 } 699 700 BOOL 701 WINAPI 702 METADC_GetAndSetDCDWord( 703 _Out_ PDWORD pdwResult, 704 _In_ HDC hdc, 705 _In_ UINT u, 706 _In_ DWORD dwIn, 707 _In_ ULONG ulMFId, 708 _In_ USHORT usMF16Id, 709 _In_ DWORD dwError); 710 711 /* EOF */ 712