2 * GDI Device Context functions
4 * Copyright 1993, 1994 Alexandre Julliard
5 * Copyright 1997 Bertho A. Stultiens
7 * Copyright 2021 Jacek Caban for CodeWeavers
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "gdi_private.h"
29 #include "wine/list.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(gdi
);
34 static struct list drivers
= LIST_INIT( drivers
);
36 static CRITICAL_SECTION driver_section
;
37 static CRITICAL_SECTION_DEBUG critsect_debug
=
39 0, 0, &driver_section
,
40 { &critsect_debug
.ProcessLocksList
, &critsect_debug
.ProcessLocksList
},
41 0, 0, { (DWORD_PTR
)(__FILE__
": driver_section") }
43 static CRITICAL_SECTION driver_section
= { &critsect_debug
, -1, 0, 0, 0, 0 };
45 typedef HDC (CDECL
*driver_entry_point
)( const WCHAR
*device
,
46 const DEVMODEW
*devmode
, const WCHAR
*output
);
48 struct graphics_driver
51 HMODULE module
; /* module handle */
52 driver_entry_point entry_point
;
57 CALL_START_PAGE
= 0x1,
67 enum print_flags flags
;
71 DC_ATTR
*get_dc_attr( HDC hdc
)
73 DWORD type
= gdi_handle_type( hdc
);
75 if ((type
& 0x1f0000) != NTGDI_OBJ_DC
|| !(dc_attr
= get_gdi_client_ptr( hdc
, 0 )))
77 SetLastError( ERROR_INVALID_HANDLE
);
80 return dc_attr
->disabled
? NULL
: dc_attr
;
83 static BOOL
is_display_device( const WCHAR
*name
)
85 const WCHAR
*p
= name
;
90 if (wcsnicmp( name
, L
"\\\\.\\DISPLAY", lstrlenW(L
"\\\\.\\DISPLAY") )) return FALSE
;
92 p
+= lstrlenW(L
"\\\\.\\DISPLAY");
94 if (!iswdigit( *p
++ ))
106 static BOOL
get_driver_name( const WCHAR
*device
, WCHAR
*driver
, DWORD size
)
110 /* display is a special case */
111 if (!wcsicmp( device
, L
"display" ) || is_display_device( device
))
113 lstrcpynW( driver
, L
"display", size
);
117 size
= GetProfileStringW(L
"devices", device
, L
"", driver
, size
);
120 WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device
));
123 p
= wcschr(driver
, ',');
126 WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device
));
130 TRACE("Found %s for %s\n", debugstr_w(driver
), debugstr_w(device
));
134 static struct graphics_driver
*create_driver( HMODULE module
)
136 struct graphics_driver
*driver
;
138 if (!(driver
= HeapAlloc( GetProcessHeap(), 0, sizeof(*driver
)))) return NULL
;
139 driver
->module
= module
;
142 driver
->entry_point
= (void *)GetProcAddress( module
, "wine_driver_open_dc" );
144 driver
->entry_point
= NULL
;
150 static const WCHAR printer_env
[] = L
"w32x86";
151 #elif defined __x86_64__
152 static const WCHAR printer_env
[] = L
"x64";
153 #elif defined __arm__
154 static const WCHAR printer_env
[] = L
"arm";
155 #elif defined __aarch64__
156 static const WCHAR printer_env
[] = L
"arm64";
158 #error not defined for this cpu
161 static driver_entry_point
load_driver( LPCWSTR name
)
164 struct graphics_driver
*driver
, *new_driver
;
166 if ((module
= GetModuleHandleW( name
)))
168 EnterCriticalSection( &driver_section
);
169 LIST_FOR_EACH_ENTRY( driver
, &drivers
, struct graphics_driver
, entry
)
171 if (driver
->module
== module
) goto done
;
173 LeaveCriticalSection( &driver_section
);
176 if (!(module
= LoadLibraryW( name
)))
178 WCHAR path
[MAX_PATH
];
180 GetSystemDirectoryW( path
, MAX_PATH
);
181 swprintf( path
+ wcslen(path
), MAX_PATH
- wcslen(path
), L
"\\spool\\drivers\\%s\\3\\%s",
183 if (!(module
= LoadLibraryW( path
))) return NULL
;
186 if (!(new_driver
= create_driver( module
)))
188 FreeLibrary( module
);
192 /* check if someone else added it in the meantime */
193 EnterCriticalSection( &driver_section
);
194 LIST_FOR_EACH_ENTRY( driver
, &drivers
, struct graphics_driver
, entry
)
196 if (driver
->module
!= module
) continue;
197 FreeLibrary( module
);
198 HeapFree( GetProcessHeap(), 0, new_driver
);
202 list_add_head( &drivers
, &driver
->entry
);
203 TRACE( "loaded driver %p for %s\n", driver
, debugstr_w(name
) );
205 LeaveCriticalSection( &driver_section
);
206 return driver
->entry_point
;
209 static BOOL
print_copy_devmode( struct print
*print
, const DEVMODEW
*devmode
)
213 if (!print
) return TRUE
;
214 if (!print
->devmode
&& !devmode
) return TRUE
;
215 HeapFree( GetProcessHeap(), 0, print
->devmode
);
219 print
->devmode
= NULL
;
220 print
->flags
|= WRITE_DEVMODE
;
224 size
= devmode
->dmSize
+ devmode
->dmDriverExtra
;
225 print
->devmode
= HeapAlloc( GetProcessHeap(), 0, size
);
226 if (!print
->devmode
) return FALSE
;
227 memcpy(print
->devmode
, devmode
, size
);
228 print
->flags
|= WRITE_DEVMODE
;
232 /***********************************************************************
233 * CreateDCW (GDI32.@)
235 HDC WINAPI
CreateDCW( LPCWSTR driver
, LPCWSTR device
, LPCWSTR output
,
236 const DEVMODEW
*devmode
)
238 UNICODE_STRING device_str
, output_str
;
239 driver_entry_point entry_point
= NULL
;
240 const WCHAR
*display
= NULL
, *p
;
241 WCHAR buf
[300], *port
= NULL
;
242 struct print
*print
= NULL
;
243 BOOL is_display
= FALSE
;
244 HANDLE hspool
= NULL
;
248 if (!device
|| !get_driver_name( device
, buf
, 300 ))
252 ERR( "no device found for %s\n", debugstr_w(device
) );
255 lstrcpyW(buf
, driver
);
260 output_str
.Length
= output_str
.MaximumLength
= lstrlenW(output
) * sizeof(WCHAR
);
261 output_str
.Buffer
= (WCHAR
*)output
;
264 if (is_display_device( driver
))
269 else if (is_display_device( device
))
274 else if (!wcsicmp( buf
, L
"display" ) || is_display_device( buf
))
278 else if (!(entry_point
= load_driver( buf
)))
280 ERR( "no driver found for %s\n", debugstr_w(buf
) );
283 else if (!OpenPrinterW( (WCHAR
*)device
, &hspool
, NULL
))
287 else if (output
&& !(port
= HeapAlloc( GetProcessHeap(), 0, output_str
.Length
+ sizeof(WCHAR
) )))
289 ClosePrinter( hspool
);
292 else if (!(print
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*print
) )) ||
293 !print_copy_devmode( print
, devmode
))
295 HeapFree( GetProcessHeap(), 0, print
);
296 ClosePrinter( hspool
);
297 HeapFree( GetProcessHeap(), 0, port
);
303 /* Use only the display name. For example, \\.\DISPLAY1 in \\.\DISPLAY1\Monitor0 */
305 while (iswdigit( *p
)) p
++;
307 device_str
.Length
= device_str
.MaximumLength
= (p
- display
) * sizeof(WCHAR
);
308 device_str
.Buffer
= (WCHAR
*)display
;
312 device_str
.Length
= device_str
.MaximumLength
= lstrlenW( device
) * sizeof(WCHAR
);
313 device_str
.Buffer
= (WCHAR
*)device
;
317 ret
= entry_point( device
, devmode
, output
);
319 ret
= NtGdiOpenDCW( device
|| display
? &device_str
: NULL
, devmode
,
320 output
? &output_str
: NULL
,
321 0, is_display
, entry_point
, NULL
, NULL
);
323 if (ret
&& hspool
&& (dc_attr
= get_dc_attr( ret
)))
327 memcpy( port
, output
, output_str
.Length
);
328 port
[output_str
.Length
/ sizeof(WCHAR
)] = 0;
330 print
->printer
= hspool
;
331 print
->output
= port
;
332 dc_attr
->print
= (UINT_PTR
)print
;
336 ClosePrinter( hspool
);
337 HeapFree( GetProcessHeap(), 0, port
);
338 HeapFree( GetProcessHeap(), 0, print
->devmode
);
339 HeapFree( GetProcessHeap(), 0, print
);
345 /***********************************************************************
346 * CreateDCA (GDI32.@)
348 HDC WINAPI
CreateDCA( const char *driver
, const char *device
, const char *output
,
349 const DEVMODEA
*init_data
)
351 UNICODE_STRING driverW
, deviceW
, outputW
;
352 DEVMODEW
*init_dataW
= NULL
;
355 if (driver
) RtlCreateUnicodeStringFromAsciiz( &driverW
, driver
);
356 else driverW
.Buffer
= NULL
;
358 if (device
) RtlCreateUnicodeStringFromAsciiz( &deviceW
, device
);
359 else deviceW
.Buffer
= NULL
;
361 if (output
) RtlCreateUnicodeStringFromAsciiz( &outputW
, output
);
362 else outputW
.Buffer
= NULL
;
366 /* don't convert init_data for DISPLAY driver, it's not used */
367 if (!driverW
.Buffer
|| wcsicmp( driverW
.Buffer
, L
"display" ))
368 init_dataW
= GdiConvertToDevmodeW( init_data
);
371 ret
= CreateDCW( driverW
.Buffer
, deviceW
.Buffer
, outputW
.Buffer
, init_dataW
);
373 RtlFreeUnicodeString( &driverW
);
374 RtlFreeUnicodeString( &deviceW
);
375 RtlFreeUnicodeString( &outputW
);
376 HeapFree( GetProcessHeap(), 0, init_dataW
);
380 /***********************************************************************
381 * CreateICA (GDI32.@)
383 HDC WINAPI
CreateICA( const char *driver
, const char *device
, const char *output
,
384 const DEVMODEA
*init_data
)
386 /* Nothing special yet for ICs */
387 return CreateDCA( driver
, device
, output
, init_data
);
391 /***********************************************************************
392 * CreateICW (GDI32.@)
394 HDC WINAPI
CreateICW( const WCHAR
*driver
, const WCHAR
*device
, const WCHAR
*output
,
395 const DEVMODEW
*init_data
)
397 /* Nothing special yet for ICs */
398 return CreateDCW( driver
, device
, output
, init_data
);
401 /***********************************************************************
402 * GdiConvertToDevmodeW (GDI32.@)
404 DEVMODEW
*WINAPI
GdiConvertToDevmodeW( const DEVMODEA
*dmA
)
407 WORD dmW_size
, dmA_size
;
409 dmA_size
= dmA
->dmSize
;
411 /* this is the minimal dmSize that XP accepts */
412 if (dmA_size
< FIELD_OFFSET(DEVMODEA
, dmFields
))
415 if (dmA_size
> sizeof(DEVMODEA
))
416 dmA_size
= sizeof(DEVMODEA
);
418 dmW_size
= dmA_size
+ CCHDEVICENAME
;
419 if (dmA_size
>= FIELD_OFFSET(DEVMODEA
, dmFormName
) + CCHFORMNAME
)
420 dmW_size
+= CCHFORMNAME
;
422 dmW
= HeapAlloc( GetProcessHeap(), 0, dmW_size
+ dmA
->dmDriverExtra
);
423 if (!dmW
) return NULL
;
425 MultiByteToWideChar( CP_ACP
, 0, (const char*) dmA
->dmDeviceName
, -1,
426 dmW
->dmDeviceName
, CCHDEVICENAME
);
427 /* copy slightly more, to avoid long computations */
428 memcpy( &dmW
->dmSpecVersion
, &dmA
->dmSpecVersion
, dmA_size
- CCHDEVICENAME
);
430 if (dmA_size
>= FIELD_OFFSET(DEVMODEA
, dmFormName
) + CCHFORMNAME
)
432 if (dmA
->dmFields
& DM_FORMNAME
)
433 MultiByteToWideChar( CP_ACP
, 0, (const char*) dmA
->dmFormName
, -1,
434 dmW
->dmFormName
, CCHFORMNAME
);
436 dmW
->dmFormName
[0] = 0;
438 if (dmA_size
> FIELD_OFFSET(DEVMODEA
, dmLogPixels
))
439 memcpy( &dmW
->dmLogPixels
, &dmA
->dmLogPixels
, dmA_size
- FIELD_OFFSET(DEVMODEA
, dmLogPixels
) );
442 if (dmA
->dmDriverExtra
)
443 memcpy( (char *)dmW
+ dmW_size
, (const char *)dmA
+ dmA_size
, dmA
->dmDriverExtra
);
445 dmW
->dmSize
= dmW_size
;
450 static inline struct print
*get_dc_print( DC_ATTR
*dc_attr
)
452 return (struct print
*)(UINT_PTR
)dc_attr
->print
;
455 void print_call_start_page( DC_ATTR
*dc_attr
)
457 struct print
*print
= get_dc_print( dc_attr
);
459 if (print
->flags
& CALL_START_PAGE
) StartPage( UlongToHandle(dc_attr
->hdc
) );
462 static void delete_print_dc( DC_ATTR
*dc_attr
)
464 struct print
*print
= get_dc_print( dc_attr
);
466 ClosePrinter( print
->printer
);
467 HeapFree( GetProcessHeap(), 0, print
->output
);
468 HeapFree( GetProcessHeap(), 0, print
->devmode
);
469 HeapFree( GetProcessHeap(), 0, print
);
473 /***********************************************************************
476 BOOL WINAPI
DeleteDC( HDC hdc
)
480 if (is_meta_dc( hdc
)) return METADC_DeleteDC( hdc
);
481 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
486 delete_print_dc( dc_attr
);
488 if (dc_attr
->emf
) EMFDC_DeleteDC( dc_attr
);
489 return NtGdiDeleteObjectApp( hdc
);
492 /***********************************************************************
495 HDC WINAPI
ResetDCA( HDC hdc
, const DEVMODEA
*devmode
)
500 if (devmode
) devmodeW
= GdiConvertToDevmodeW( devmode
);
501 else devmodeW
= NULL
;
503 ret
= ResetDCW( hdc
, devmodeW
);
505 HeapFree( GetProcessHeap(), 0, devmodeW
);
509 /***********************************************************************
512 HDC WINAPI
ResetDCW( HDC hdc
, const DEVMODEW
*devmode
)
517 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
518 print
= get_dc_print( dc_attr
);
519 if (print
&& print
->flags
& CALL_END_PAGE
) return 0;
520 if (!NtGdiResetDC( hdc
, devmode
, NULL
, NULL
, NULL
)) return 0;
521 if (print
&& !print_copy_devmode( print
, devmode
)) return 0;
525 /***********************************************************************
528 INT WINAPI
SaveDC( HDC hdc
)
532 if (is_meta_dc( hdc
)) return METADC_SaveDC( hdc
);
533 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
534 if (dc_attr
->emf
&& !EMFDC_SaveDC( dc_attr
)) return FALSE
;
535 return NtGdiSaveDC( hdc
);
538 /***********************************************************************
539 * RestoreDC (GDI32.@)
541 BOOL WINAPI
RestoreDC( HDC hdc
, INT level
)
545 if (is_meta_dc( hdc
)) return METADC_RestoreDC( hdc
, level
);
546 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
547 if (dc_attr
->emf
&& !EMFDC_RestoreDC( dc_attr
, level
)) return FALSE
;
548 return NtGdiRestoreDC( hdc
, level
);
551 /***********************************************************************
552 * GetDeviceCaps (GDI32.@)
554 INT WINAPI
GetDeviceCaps( HDC hdc
, INT cap
)
556 if (is_meta_dc( hdc
)) return METADC_GetDeviceCaps( hdc
, cap
);
557 if (!get_dc_attr( hdc
)) return FALSE
;
558 return NtGdiGetDeviceCaps( hdc
, cap
);
561 /***********************************************************************
564 INT WINAPI
Escape( HDC hdc
, INT escape
, INT in_count
, const char *in_data
, void *out_data
)
572 return AbortDoc( hdc
);
576 RECT
*rect
= out_data
;
580 if (!(dc_attr
= get_dc_attr( hdc
)) || !(print
= get_dc_print( dc_attr
))) break;
581 if (print
->flags
& BANDING
)
583 print
->flags
&= ~BANDING
;
584 SetRectEmpty( rect
);
585 return EndPage( hdc
);
587 print
->flags
|= BANDING
;
588 SetRect( rect
, 0, 0, GetDeviceCaps(hdc
, HORZRES
), GetDeviceCaps(hdc
, VERTRES
) );
593 return EndDoc( hdc
);
595 case GETPHYSPAGESIZE
:
597 pt
->x
= GetDeviceCaps( hdc
, PHYSICALWIDTH
);
598 pt
->y
= GetDeviceCaps( hdc
, PHYSICALHEIGHT
);
601 case GETPRINTINGOFFSET
:
603 pt
->x
= GetDeviceCaps( hdc
, PHYSICALOFFSETX
);
604 pt
->y
= GetDeviceCaps( hdc
, PHYSICALOFFSETY
);
607 case GETSCALINGFACTOR
:
609 pt
->x
= GetDeviceCaps( hdc
, SCALINGFACTORX
);
610 pt
->y
= GetDeviceCaps( hdc
, SCALINGFACTORY
);
614 return EndPage( hdc
);
617 return SetAbortProc( hdc
, (ABORTPROC
)in_data
);
624 /* in_data may not be 0 terminated so we must copy it */
627 name
= HeapAlloc( GetProcessHeap(), 0, in_count
+1 );
628 memcpy( name
, in_data
, in_count
);
631 /* out_data is actually a pointer to the DocInfo structure and used as
632 * a second input parameter */
633 if (out_data
) doc
= *(DOCINFOA
*)out_data
;
636 doc
.cbSize
= sizeof(doc
);
637 doc
.lpszOutput
= NULL
;
638 doc
.lpszDatatype
= NULL
;
641 doc
.lpszDocName
= name
;
642 ret
= StartDocA( hdc
, &doc
);
643 HeapFree( GetProcessHeap(), 0, name
);
644 if (ret
> 0) ret
= StartPage( hdc
);
648 case QUERYESCSUPPORT
:
652 if (in_count
< sizeof(SHORT
)) return 0;
653 code
= (in_count
< sizeof(DWORD
)) ? *(const USHORT
*)in_data
: *(const DWORD
*)in_data
;
658 case GETPHYSPAGESIZE
:
659 case GETPRINTINGOFFSET
:
660 case GETSCALINGFACTOR
:
662 case QUERYESCSUPPORT
:
671 case POSTSCRIPT_PASSTHROUGH
:
672 in_count
= *(const WORD
*)in_data
+ sizeof(WORD
);
677 /* if not handled internally, pass it to the driver */
678 return ExtEscape( hdc
, escape
, in_count
, in_data
, 0, out_data
);
681 /***********************************************************************
682 * ExtEscape [GDI32.@]
684 INT WINAPI
ExtEscape( HDC hdc
, INT escape
, INT input_size
, const char *input
,
685 INT output_size
, char *output
)
690 if (is_meta_dc( hdc
))
691 return METADC_ExtEscape( hdc
, escape
, input_size
, input
, output_size
, output
);
692 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
693 if ((print
= get_dc_print( dc_attr
)) && dc_attr
->emf
)
695 int ret
= EMFDC_ExtEscape( dc_attr
, escape
, input_size
, input
, output_size
, output
);
698 return NtGdiExtEscape( hdc
, NULL
, 0, escape
, input_size
, input
, output_size
, output
);
701 /***********************************************************************
702 * GetTextAlign (GDI32.@)
704 UINT WINAPI
GetTextAlign( HDC hdc
)
706 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
707 return dc_attr
? dc_attr
->text_align
: 0;
710 /***********************************************************************
711 * SetTextAlign (GDI32.@)
713 UINT WINAPI
SetTextAlign( HDC hdc
, UINT align
)
718 TRACE("hdc=%p align=%d\n", hdc
, align
);
720 if (is_meta_dc( hdc
)) return METADC_SetTextAlign( hdc
, align
);
721 if (!(dc_attr
= get_dc_attr( hdc
))) return GDI_ERROR
;
722 if (dc_attr
->emf
&& !EMFDC_SetTextAlign( dc_attr
, align
)) return GDI_ERROR
;
724 ret
= dc_attr
->text_align
;
725 dc_attr
->text_align
= align
;
729 /***********************************************************************
730 * GetBkColor (GDI32.@)
732 COLORREF WINAPI
GetBkColor( HDC hdc
)
734 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
735 return dc_attr
? dc_attr
->background_color
: CLR_INVALID
;
738 /***********************************************************************
739 * SetBkColor (GDI32.@)
741 COLORREF WINAPI
SetBkColor( HDC hdc
, COLORREF color
)
746 if (is_meta_dc( hdc
)) return METADC_SetBkColor( hdc
, color
);
747 if (!(dc_attr
= get_dc_attr( hdc
))) return CLR_INVALID
;
748 if (dc_attr
->emf
&& !EMFDC_SetBkColor( dc_attr
, color
)) return CLR_INVALID
;
749 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetBkColor
, color
, &ret
) ? ret
: CLR_INVALID
;
752 /***********************************************************************
753 * GetDCBrushColor (GDI32.@)
755 COLORREF WINAPI
GetDCBrushColor( HDC hdc
)
757 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
758 return dc_attr
? dc_attr
->brush_color
: CLR_INVALID
;
761 /***********************************************************************
762 * SetDCBrushColor (GDI32.@)
764 COLORREF WINAPI
SetDCBrushColor( HDC hdc
, COLORREF color
)
769 if (!(dc_attr
= get_dc_attr( hdc
))) return CLR_INVALID
;
770 if (dc_attr
->emf
&& !EMFDC_SetDCBrushColor( dc_attr
, color
)) return CLR_INVALID
;
771 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetDCBrushColor
, color
, &ret
) ? ret
: CLR_INVALID
;
774 /***********************************************************************
775 * GetDCPenColor (GDI32.@)
777 COLORREF WINAPI
GetDCPenColor(HDC hdc
)
779 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
780 return dc_attr
? dc_attr
->pen_color
: CLR_INVALID
;
783 /***********************************************************************
784 * SetDCPenColor (GDI32.@)
786 COLORREF WINAPI
SetDCPenColor( HDC hdc
, COLORREF color
)
791 if (!(dc_attr
= get_dc_attr( hdc
))) return CLR_INVALID
;
792 if (dc_attr
->emf
&& !EMFDC_SetDCPenColor( dc_attr
, color
)) return CLR_INVALID
;
793 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetDCPenColor
, color
, &ret
) ? ret
: CLR_INVALID
;
796 /***********************************************************************
797 * GetTextColor (GDI32.@)
799 COLORREF WINAPI
GetTextColor( HDC hdc
)
801 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
802 return dc_attr
? dc_attr
->text_color
: 0;
805 /***********************************************************************
806 * SetTextColor (GDI32.@)
808 COLORREF WINAPI
SetTextColor( HDC hdc
, COLORREF color
)
813 if (is_meta_dc( hdc
)) return METADC_SetTextColor( hdc
, color
);
814 if (!(dc_attr
= get_dc_attr( hdc
))) return CLR_INVALID
;
815 if (dc_attr
->emf
&& !EMFDC_SetTextColor( dc_attr
, color
)) return CLR_INVALID
;
816 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetTextColor
, color
, &ret
) ? ret
: CLR_INVALID
;
819 /***********************************************************************
820 * GetBkMode (GDI32.@)
822 INT WINAPI
GetBkMode( HDC hdc
)
824 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
825 return dc_attr
? dc_attr
->background_mode
: 0;
828 /***********************************************************************
829 * SetBkMode (GDI32.@)
831 INT WINAPI
SetBkMode( HDC hdc
, INT mode
)
836 if (mode
<= 0 || mode
> BKMODE_LAST
)
838 SetLastError(ERROR_INVALID_PARAMETER
);
842 if (is_meta_dc( hdc
)) return METADC_SetBkMode( hdc
, mode
);
843 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
844 if (dc_attr
->emf
&& !EMFDC_SetBkMode( dc_attr
, mode
)) return 0;
846 ret
= dc_attr
->background_mode
;
847 dc_attr
->background_mode
= mode
;
851 /***********************************************************************
852 * GetGraphicsMode (GDI32.@)
854 INT WINAPI
GetGraphicsMode( HDC hdc
)
856 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
857 return dc_attr
? dc_attr
->graphics_mode
: 0;
860 /***********************************************************************
861 * SetGraphicsMode (GDI32.@)
863 INT WINAPI
SetGraphicsMode( HDC hdc
, INT mode
)
866 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetGraphicsMode
, mode
, &ret
) ? ret
: 0;
869 /***********************************************************************
870 * GetArcDirection (GDI32.@)
872 INT WINAPI
GetArcDirection( HDC hdc
)
874 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
875 return dc_attr
? dc_attr
->arc_direction
: 0;
878 /***********************************************************************
879 * SetArcDirection (GDI32.@)
881 INT WINAPI
SetArcDirection( HDC hdc
, INT dir
)
886 if (dir
!= AD_COUNTERCLOCKWISE
&& dir
!= AD_CLOCKWISE
)
888 SetLastError(ERROR_INVALID_PARAMETER
);
892 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
893 if (dc_attr
->emf
&& !EMFDC_SetArcDirection( dc_attr
, dir
)) return 0;
895 ret
= dc_attr
->arc_direction
;
896 dc_attr
->arc_direction
= dir
;
900 /***********************************************************************
901 * GetLayout (GDI32.@)
903 DWORD WINAPI
GetLayout( HDC hdc
)
905 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
906 return dc_attr
? dc_attr
->layout
: GDI_ERROR
;
909 /***********************************************************************
910 * SetLayout (GDI32.@)
912 DWORD WINAPI
SetLayout( HDC hdc
, DWORD layout
)
916 if (is_meta_dc( hdc
)) return METADC_SetLayout( hdc
, layout
);
917 if (!(dc_attr
= get_dc_attr( hdc
))) return GDI_ERROR
;
918 if (dc_attr
->emf
&& !EMFDC_SetLayout( dc_attr
, layout
)) return GDI_ERROR
;
919 return NtGdiSetLayout( hdc
, -1, layout
);
922 /***********************************************************************
923 * GetMapMode (GDI32.@)
925 INT WINAPI
GetMapMode( HDC hdc
)
927 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
928 return dc_attr
? dc_attr
->map_mode
: 0;
931 /***********************************************************************
932 * SetMapMode (GDI32.@)
934 INT WINAPI
SetMapMode( HDC hdc
, INT mode
)
939 TRACE("%p %d\n", hdc
, mode
);
941 if (is_meta_dc( hdc
)) return METADC_SetMapMode( hdc
, mode
);
942 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
943 if (dc_attr
->emf
&& !EMFDC_SetMapMode( dc_attr
, mode
)) return 0;
944 return NtGdiGetAndSetDCDword( hdc
, NtGdiSetMapMode
, mode
, &ret
) ? ret
: 0;
947 /***********************************************************************
948 * GetTextCharacterExtra (GDI32.@)
950 INT WINAPI
GetTextCharacterExtra( HDC hdc
)
952 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
953 return dc_attr
? dc_attr
->char_extra
: 0x80000000;
956 /***********************************************************************
957 * SetTextCharacterExtra (GDI32.@)
959 INT WINAPI
SetTextCharacterExtra( HDC hdc
, INT extra
)
964 if (is_meta_dc( hdc
)) return METADC_SetTextCharacterExtra( hdc
, extra
);
965 if (!(dc_attr
= get_dc_attr( hdc
))) return 0x8000000;
966 ret
= dc_attr
->char_extra
;
967 dc_attr
->char_extra
= extra
;
971 /***********************************************************************
972 * SetMapperFlags (GDI32.@)
974 DWORD WINAPI
SetMapperFlags( HDC hdc
, DWORD flags
)
979 if (is_meta_dc( hdc
)) return METADC_SetMapperFlags( hdc
, flags
);
980 if (!(dc_attr
= get_dc_attr( hdc
))) return GDI_ERROR
;
981 if (dc_attr
->emf
&& !EMFDC_SetMapperFlags( dc_attr
, flags
)) return GDI_ERROR
;
982 ret
= dc_attr
->mapper_flags
;
983 dc_attr
->mapper_flags
= flags
;
987 /***********************************************************************
988 * GetPolyFillMode (GDI32.@)
990 INT WINAPI
GetPolyFillMode( HDC hdc
)
992 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
993 return dc_attr
? dc_attr
->poly_fill_mode
: 0;
996 /***********************************************************************
997 * SetPolyFillMode (GDI32.@)
999 INT WINAPI
SetPolyFillMode( HDC hdc
, INT mode
)
1004 if (mode
<= 0 || mode
> POLYFILL_LAST
)
1006 SetLastError(ERROR_INVALID_PARAMETER
);
1010 if (is_meta_dc( hdc
)) return METADC_SetPolyFillMode( hdc
, mode
);
1011 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
1012 if (dc_attr
->emf
&& !EMFDC_SetPolyFillMode( dc_attr
, mode
)) return 0;
1014 ret
= dc_attr
->poly_fill_mode
;
1015 dc_attr
->poly_fill_mode
= mode
;
1019 /***********************************************************************
1020 * GetStretchBltMode (GDI32.@)
1022 INT WINAPI
GetStretchBltMode( HDC hdc
)
1024 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
1025 return dc_attr
? dc_attr
->stretch_blt_mode
: 0;
1028 /***********************************************************************
1029 * GetBrushOrgEx (GDI32.@)
1031 BOOL WINAPI
GetBrushOrgEx( HDC hdc
, POINT
*point
)
1034 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1035 *point
= dc_attr
->brush_org
;
1039 /***********************************************************************
1040 * SetBrushOrgEx (GDI32.@)
1042 BOOL WINAPI
SetBrushOrgEx( HDC hdc
, INT x
, INT y
, POINT
*oldorg
)
1045 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1046 if (oldorg
) *oldorg
= dc_attr
->brush_org
;
1047 dc_attr
->brush_org
.x
= x
;
1048 dc_attr
->brush_org
.y
= y
;
1052 /***********************************************************************
1053 * FixBrushOrgEx (GDI32.@)
1055 BOOL WINAPI
FixBrushOrgEx( HDC hdc
, INT x
, INT y
, POINT
*oldorg
)
1057 return SetBrushOrgEx( hdc
, x
, y
, oldorg
);
1060 /***********************************************************************
1061 * GetDCOrgEx (GDI32.@)
1063 BOOL WINAPI
GetDCOrgEx( HDC hdc
, POINT
*point
)
1066 if (!point
|| !(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1067 point
->x
= dc_attr
->vis_rect
.left
;
1068 point
->y
= dc_attr
->vis_rect
.top
;
1072 /***********************************************************************
1073 * GetWindowExtEx (GDI32.@)
1075 BOOL WINAPI
GetWindowExtEx( HDC hdc
, SIZE
*size
)
1078 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1079 *size
= dc_attr
->wnd_ext
;
1083 /***********************************************************************
1084 * SetWindowExtEx (GDI32.@)
1086 BOOL WINAPI
SetWindowExtEx( HDC hdc
, INT x
, INT y
, SIZE
*size
)
1090 if (is_meta_dc( hdc
)) return METADC_SetWindowExtEx( hdc
, x
, y
);
1091 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1092 if (dc_attr
->emf
&& !EMFDC_SetWindowExtEx( dc_attr
, x
, y
)) return FALSE
;
1094 if (size
) *size
= dc_attr
->wnd_ext
;
1095 if (dc_attr
->map_mode
!= MM_ISOTROPIC
&& dc_attr
->map_mode
!= MM_ANISOTROPIC
) return TRUE
;
1096 if (!x
|| !y
) return FALSE
;
1097 dc_attr
->wnd_ext
.cx
= x
;
1098 dc_attr
->wnd_ext
.cy
= y
;
1099 return NtGdiComputeXformCoefficients( hdc
);
1102 /***********************************************************************
1103 * GetWindowOrgEx (GDI32.@)
1105 BOOL WINAPI
GetWindowOrgEx( HDC hdc
, POINT
*point
)
1108 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1109 *point
= dc_attr
->wnd_org
;
1113 /***********************************************************************
1114 * SetWindowOrgEx (GDI32.@)
1116 BOOL WINAPI
SetWindowOrgEx( HDC hdc
, INT x
, INT y
, POINT
*point
)
1120 if (is_meta_dc( hdc
)) return METADC_SetWindowOrgEx( hdc
, x
, y
);
1121 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1122 if (dc_attr
->emf
&& !EMFDC_SetWindowOrgEx( dc_attr
, x
, y
)) return FALSE
;
1124 if (point
) *point
= dc_attr
->wnd_org
;
1125 dc_attr
->wnd_org
.x
= x
;
1126 dc_attr
->wnd_org
.y
= y
;
1127 return NtGdiComputeXformCoefficients( hdc
);
1130 /***********************************************************************
1131 * OffsetWindowOrgEx (GDI32.@)
1133 BOOL WINAPI
OffsetWindowOrgEx( HDC hdc
, INT x
, INT y
, POINT
*point
)
1137 if (is_meta_dc( hdc
)) return METADC_OffsetWindowOrgEx( hdc
, x
, y
);
1138 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1139 if (point
) *point
= dc_attr
->wnd_org
;
1140 dc_attr
->wnd_org
.x
+= x
;
1141 dc_attr
->wnd_org
.y
+= y
;
1142 if (dc_attr
->emf
&& !EMFDC_SetWindowOrgEx( dc_attr
, dc_attr
->wnd_org
.x
,
1143 dc_attr
->wnd_org
.y
)) return FALSE
;
1144 return NtGdiComputeXformCoefficients( hdc
);
1147 /***********************************************************************
1148 * GetViewportExtEx (GDI32.@)
1150 BOOL WINAPI
GetViewportExtEx( HDC hdc
, SIZE
*size
)
1153 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1154 *size
= dc_attr
->vport_ext
;
1158 /***********************************************************************
1159 * SetViewportExtEx (GDI32.@)
1161 BOOL WINAPI
SetViewportExtEx( HDC hdc
, INT x
, INT y
, LPSIZE size
)
1165 if (is_meta_dc( hdc
)) return METADC_SetViewportExtEx( hdc
, x
, y
);
1166 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1167 if (dc_attr
->emf
&& !EMFDC_SetViewportExtEx( dc_attr
, x
, y
)) return FALSE
;
1169 if (size
) *size
= dc_attr
->vport_ext
;
1170 if (dc_attr
->map_mode
!= MM_ISOTROPIC
&& dc_attr
->map_mode
!= MM_ANISOTROPIC
) return TRUE
;
1171 if (!x
|| !y
) return FALSE
;
1172 dc_attr
->vport_ext
.cx
= x
;
1173 dc_attr
->vport_ext
.cy
= y
;
1174 return NtGdiComputeXformCoefficients( hdc
);
1177 /***********************************************************************
1178 * GetViewportOrgEx (GDI32.@)
1180 BOOL WINAPI
GetViewportOrgEx( HDC hdc
, POINT
*point
)
1183 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1184 *point
= dc_attr
->vport_org
;
1188 /***********************************************************************
1189 * SetViewportOrgEx (GDI32.@)
1191 BOOL WINAPI
SetViewportOrgEx( HDC hdc
, INT x
, INT y
, POINT
*point
)
1195 if (is_meta_dc( hdc
)) return METADC_SetViewportOrgEx( hdc
, x
, y
);
1196 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1197 if (dc_attr
->emf
&& !EMFDC_SetViewportOrgEx( dc_attr
, x
, y
)) return FALSE
;
1199 if (point
) *point
= dc_attr
->vport_org
;
1200 dc_attr
->vport_org
.x
= x
;
1201 dc_attr
->vport_org
.y
= y
;
1202 return NtGdiComputeXformCoefficients( hdc
);
1205 /***********************************************************************
1206 * OffsetViewportOrgEx (GDI32.@)
1208 BOOL WINAPI
OffsetViewportOrgEx( HDC hdc
, INT x
, INT y
, POINT
*point
)
1212 if (is_meta_dc( hdc
)) return METADC_OffsetViewportOrgEx( hdc
, x
, y
);
1213 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1214 if (point
) *point
= dc_attr
->vport_org
;
1215 dc_attr
->vport_org
.x
+= x
;
1216 dc_attr
->vport_org
.y
+= y
;
1217 if (dc_attr
->emf
&& !EMFDC_SetViewportOrgEx( dc_attr
, dc_attr
->vport_org
.x
,
1218 dc_attr
->vport_org
.y
)) return FALSE
;
1219 return NtGdiComputeXformCoefficients( hdc
);
1222 /***********************************************************************
1223 * GetWorldTransform (GDI32.@)
1225 BOOL WINAPI
GetWorldTransform( HDC hdc
, XFORM
*xform
)
1227 return NtGdiGetTransform( hdc
, 0x203, xform
);
1230 /****************************************************************************
1231 * ModifyWorldTransform (GDI32.@)
1233 BOOL WINAPI
ModifyWorldTransform( HDC hdc
, const XFORM
*xform
, DWORD mode
)
1237 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1238 if (dc_attr
->emf
&& !EMFDC_ModifyWorldTransform( dc_attr
, xform
, mode
)) return FALSE
;
1239 return NtGdiModifyWorldTransform( hdc
, xform
, mode
);
1242 /***********************************************************************
1243 * SetWorldTransform (GDI32.@)
1245 BOOL WINAPI
SetWorldTransform( HDC hdc
, const XFORM
*xform
)
1249 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1250 if (dc_attr
->emf
&& !EMFDC_SetWorldTransform( dc_attr
, xform
)) return FALSE
;
1251 return NtGdiModifyWorldTransform( hdc
, xform
, MWT_SET
);
1254 /***********************************************************************
1255 * SetStretchBltMode (GDI32.@)
1257 INT WINAPI
SetStretchBltMode( HDC hdc
, INT mode
)
1262 if (mode
<= 0 || mode
> MAXSTRETCHBLTMODE
)
1264 SetLastError(ERROR_INVALID_PARAMETER
);
1268 if (is_meta_dc( hdc
)) return METADC_SetStretchBltMode( hdc
, mode
);
1269 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
1270 if (dc_attr
->emf
&& !EMFDC_SetStretchBltMode( dc_attr
, mode
)) return 0;
1272 ret
= dc_attr
->stretch_blt_mode
;
1273 dc_attr
->stretch_blt_mode
= mode
;
1277 /***********************************************************************
1278 * GetCurrentPositionEx (GDI32.@)
1280 BOOL WINAPI
GetCurrentPositionEx( HDC hdc
, POINT
*point
)
1283 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1284 *point
= dc_attr
->cur_pos
;
1288 /***********************************************************************
1291 INT WINAPI
GetROP2( HDC hdc
)
1293 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
1294 return dc_attr
? dc_attr
->rop_mode
: 0;
1297 /***********************************************************************
1298 * GetRelAbs (GDI32.@)
1300 INT WINAPI
GetRelAbs( HDC hdc
, DWORD ignore
)
1302 DC_ATTR
*dc_attr
= get_dc_attr( hdc
);
1303 return dc_attr
? dc_attr
->rel_abs_mode
: 0;
1306 /***********************************************************************
1307 * SetRelAbs (GDI32.@)
1309 INT WINAPI
SetRelAbs( HDC hdc
, INT mode
)
1314 if (mode
!= ABSOLUTE
&& mode
!= RELATIVE
)
1316 SetLastError(ERROR_INVALID_PARAMETER
);
1320 if (is_meta_dc( hdc
)) return METADC_SetRelAbs( hdc
, mode
);
1321 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
1322 ret
= dc_attr
->rel_abs_mode
;
1323 dc_attr
->rel_abs_mode
= mode
;
1327 /***********************************************************************
1330 INT WINAPI
SetROP2( HDC hdc
, INT mode
)
1335 if ((mode
< R2_BLACK
) || (mode
> R2_WHITE
))
1337 SetLastError(ERROR_INVALID_PARAMETER
);
1341 if (is_meta_dc( hdc
)) return METADC_SetROP2( hdc
, mode
);
1342 if (!(dc_attr
= get_dc_attr( hdc
))) return 0;
1343 if (dc_attr
->emf
&& !EMFDC_SetROP2( dc_attr
, mode
)) return 0;
1345 ret
= dc_attr
->rop_mode
;
1346 dc_attr
->rop_mode
= mode
;
1350 /***********************************************************************
1351 * GetMiterLimit (GDI32.@)
1353 BOOL WINAPI
GetMiterLimit( HDC hdc
, FLOAT
*limit
)
1356 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1357 if (limit
) *limit
= dc_attr
->miter_limit
;
1361 /*******************************************************************
1362 * SetMiterLimit (GDI32.@)
1364 BOOL WINAPI
SetMiterLimit( HDC hdc
, FLOAT limit
, FLOAT
*old_limit
)
1367 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1368 /* FIXME: record EMFs */
1369 if (old_limit
) *old_limit
= dc_attr
->miter_limit
;
1370 dc_attr
->miter_limit
= limit
;
1374 /***********************************************************************
1375 * SetPixel (GDI32.@)
1377 COLORREF WINAPI
SetPixel( HDC hdc
, INT x
, INT y
, COLORREF color
)
1381 if (is_meta_dc( hdc
)) return METADC_SetPixel( hdc
, x
, y
, color
);
1382 if (!(dc_attr
= get_dc_attr( hdc
))) return CLR_INVALID
;
1383 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1384 if (dc_attr
->emf
&& !EMFDC_SetPixel( dc_attr
, x
, y
, color
)) return CLR_INVALID
;
1385 return NtGdiSetPixel( hdc
, x
, y
, color
);
1388 /***********************************************************************
1389 * SetPixelV (GDI32.@)
1391 BOOL WINAPI
SetPixelV( HDC hdc
, INT x
, INT y
, COLORREF color
)
1393 return SetPixel( hdc
, x
, y
, color
) != CLR_INVALID
;
1396 /***********************************************************************
1399 BOOL WINAPI
LineTo( HDC hdc
, INT x
, INT y
)
1403 TRACE( "%p, (%d, %d)\n", hdc
, x
, y
);
1405 if (is_meta_dc( hdc
)) return METADC_LineTo( hdc
, x
, y
);
1406 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1407 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1408 if (dc_attr
->emf
&& !EMFDC_LineTo( dc_attr
, x
, y
)) return FALSE
;
1409 return NtGdiLineTo( hdc
, x
, y
);
1412 /***********************************************************************
1413 * MoveToEx (GDI32.@)
1415 BOOL WINAPI
MoveToEx( HDC hdc
, INT x
, INT y
, POINT
*pt
)
1419 TRACE( "%p, (%d, %d), %p\n", hdc
, x
, y
, pt
);
1421 if (is_meta_dc( hdc
)) return METADC_MoveTo( hdc
, x
, y
);
1422 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1423 if (dc_attr
->emf
&& !EMFDC_MoveTo( dc_attr
, x
, y
)) return FALSE
;
1424 return NtGdiMoveTo( hdc
, x
, y
, pt
);
1427 /***********************************************************************
1430 BOOL WINAPI
Arc( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
,
1431 INT xstart
, INT ystart
, INT xend
, INT yend
)
1435 TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc
, left
, top
,
1436 right
, bottom
, xstart
, ystart
, xend
, yend
);
1438 if (is_meta_dc( hdc
))
1439 return METADC_Arc( hdc
, left
, top
, right
, bottom
,
1440 xstart
, ystart
, xend
, yend
);
1442 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1443 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1444 if (dc_attr
->emf
&& !EMFDC_ArcChordPie( dc_attr
, left
, top
, right
, bottom
,
1445 xstart
, ystart
, xend
, yend
, EMR_ARC
))
1448 return NtGdiArcInternal( NtGdiArc
, hdc
, left
, top
, right
, bottom
,
1449 xstart
, ystart
, xend
, yend
);
1452 /***********************************************************************
1455 BOOL WINAPI
ArcTo( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
,
1456 INT xstart
, INT ystart
, INT xend
, INT yend
)
1460 TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc
, left
, top
,
1461 right
, bottom
, xstart
, ystart
, xend
, yend
);
1463 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1464 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1465 if (dc_attr
->emf
&& !EMFDC_ArcChordPie( dc_attr
, left
, top
, right
, bottom
,
1466 xstart
, ystart
, xend
, yend
, EMR_ARCTO
))
1469 return NtGdiArcInternal( NtGdiArcTo
, hdc
, left
, top
, right
, bottom
,
1470 xstart
, ystart
, xend
, yend
);
1473 /***********************************************************************
1476 BOOL WINAPI
Chord( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
,
1477 INT xstart
, INT ystart
, INT xend
, INT yend
)
1481 TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc
, left
, top
,
1482 right
, bottom
, xstart
, ystart
, xend
, yend
);
1484 if (is_meta_dc( hdc
))
1485 return METADC_Chord( hdc
, left
, top
, right
, bottom
,
1486 xstart
, ystart
, xend
, yend
);
1488 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1489 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1490 if (dc_attr
->emf
&& !EMFDC_ArcChordPie( dc_attr
, left
, top
, right
, bottom
,
1491 xstart
, ystart
, xend
, yend
, EMR_CHORD
))
1494 return NtGdiArcInternal( NtGdiChord
, hdc
, left
, top
, right
, bottom
,
1495 xstart
, ystart
, xend
, yend
);
1498 /***********************************************************************
1501 BOOL WINAPI
Pie( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
,
1502 INT xstart
, INT ystart
, INT xend
, INT yend
)
1506 TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc
, left
, top
,
1507 right
, bottom
, xstart
, ystart
, xend
, yend
);
1509 if (is_meta_dc( hdc
))
1510 return METADC_Pie( hdc
, left
, top
, right
, bottom
,
1511 xstart
, ystart
, xend
, yend
);
1513 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1514 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1515 if (dc_attr
->emf
&& !EMFDC_ArcChordPie( dc_attr
, left
, top
, right
, bottom
,
1516 xstart
, ystart
, xend
, yend
, EMR_PIE
))
1519 return NtGdiArcInternal( NtGdiPie
, hdc
, left
, top
, right
, bottom
,
1520 xstart
, ystart
, xend
, yend
);
1523 /***********************************************************************
1524 * AngleArc (GDI32.@)
1526 BOOL WINAPI
AngleArc( HDC hdc
, INT x
, INT y
, DWORD radius
, FLOAT start_angle
, FLOAT sweep_angle
)
1530 TRACE( "%p, (%d, %d), %lu, %f, %f\n", hdc
, x
, y
, radius
, start_angle
, sweep_angle
);
1532 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1533 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1534 if (dc_attr
->emf
&& !EMFDC_AngleArc( dc_attr
, x
, y
, radius
, start_angle
, sweep_angle
))
1536 return NtGdiAngleArc( hdc
, x
, y
, radius
, *(DWORD
*)&start_angle
, *(DWORD
*)&sweep_angle
);
1539 /***********************************************************************
1542 BOOL WINAPI
Ellipse( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
)
1546 TRACE( "%p, (%d, %d)-(%d, %d)\n", hdc
, left
, top
, right
, bottom
);
1548 if (is_meta_dc( hdc
)) return METADC_Ellipse( hdc
, left
, top
, right
, bottom
);
1549 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1550 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1551 if (dc_attr
->emf
&& !EMFDC_Ellipse( dc_attr
, left
, top
, right
, bottom
)) return FALSE
;
1552 return NtGdiEllipse( hdc
, left
, top
, right
, bottom
);
1555 /***********************************************************************
1556 * Rectangle (GDI32.@)
1558 BOOL WINAPI
Rectangle( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
)
1562 TRACE( "%p, (%d, %d)-(%d, %d)\n", hdc
, left
, top
, right
, bottom
);
1564 if (is_meta_dc( hdc
)) return METADC_Rectangle( hdc
, left
, top
, right
, bottom
);
1565 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1566 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1567 if (dc_attr
->emf
&& !EMFDC_Rectangle( dc_attr
, left
, top
, right
, bottom
)) return FALSE
;
1568 return NtGdiRectangle( hdc
, left
, top
, right
, bottom
);
1571 /***********************************************************************
1572 * RoundRect (GDI32.@)
1574 BOOL WINAPI
RoundRect( HDC hdc
, INT left
, INT top
, INT right
,
1575 INT bottom
, INT ell_width
, INT ell_height
)
1579 TRACE( "%p, (%d, %d)-(%d, %d), %dx%d\n", hdc
, left
, top
, right
, bottom
,
1580 ell_width
, ell_height
);
1582 if (is_meta_dc( hdc
))
1583 return METADC_RoundRect( hdc
, left
, top
, right
, bottom
, ell_width
, ell_height
);
1585 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1586 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1587 if (dc_attr
->emf
&& !EMFDC_RoundRect( dc_attr
, left
, top
, right
, bottom
,
1588 ell_width
, ell_height
))
1591 return NtGdiRoundRect( hdc
, left
, top
, right
, bottom
, ell_width
, ell_height
);
1594 /**********************************************************************
1597 BOOL WINAPI
Polygon( HDC hdc
, const POINT
*points
, INT count
)
1601 TRACE( "%p, %p, %d\n", hdc
, points
, count
);
1603 if (is_meta_dc( hdc
)) return METADC_Polygon( hdc
, points
, count
);
1604 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1605 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1606 if (dc_attr
->emf
&& !EMFDC_Polygon( dc_attr
, points
, count
)) return FALSE
;
1607 return NtGdiPolyPolyDraw( hdc
, points
, (const ULONG
*)&count
, 1, NtGdiPolyPolygon
);
1610 /**********************************************************************
1611 * PolyPolygon (GDI32.@)
1613 BOOL WINAPI
PolyPolygon( HDC hdc
, const POINT
*points
, const INT
*counts
, UINT polygons
)
1617 TRACE( "%p, %p, %p, %u\n", hdc
, points
, counts
, polygons
);
1619 if (is_meta_dc( hdc
)) return METADC_PolyPolygon( hdc
, points
, counts
, polygons
);
1620 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1621 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1622 if (dc_attr
->emf
&& !EMFDC_PolyPolygon( dc_attr
, points
, counts
, polygons
)) return FALSE
;
1623 return NtGdiPolyPolyDraw( hdc
, points
, (const ULONG
*)counts
, polygons
, NtGdiPolyPolygon
);
1626 /**********************************************************************
1627 * Polyline (GDI32.@)
1629 BOOL WINAPI
Polyline( HDC hdc
, const POINT
*points
, INT count
)
1633 TRACE( "%p, %p, %d\n", hdc
, points
, count
);
1635 if (is_meta_dc( hdc
)) return METADC_Polyline( hdc
, points
, count
);
1636 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1637 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1638 if (dc_attr
->emf
&& !EMFDC_Polyline( dc_attr
, points
, count
)) return FALSE
;
1639 return NtGdiPolyPolyDraw( hdc
, points
, (const ULONG
*)&count
, 1, NtGdiPolyPolyline
);
1642 /**********************************************************************
1643 * PolyPolyline (GDI32.@)
1645 BOOL WINAPI
PolyPolyline( HDC hdc
, const POINT
*points
, const DWORD
*counts
, DWORD polylines
)
1649 TRACE( "%p, %p, %p, %lu\n", hdc
, points
, counts
, polylines
);
1651 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1652 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1653 if (dc_attr
->emf
&& !EMFDC_PolyPolyline( dc_attr
, points
, counts
, polylines
)) return FALSE
;
1654 return NtGdiPolyPolyDraw( hdc
, points
, counts
, polylines
, NtGdiPolyPolyline
);
1657 /******************************************************************************
1658 * PolyBezier (GDI32.@)
1660 BOOL WINAPI
PolyBezier( HDC hdc
, const POINT
*points
, DWORD count
)
1664 TRACE( "%p, %p, %lu\n", hdc
, points
, count
);
1666 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1667 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1668 if (dc_attr
->emf
&& !EMFDC_PolyBezier( dc_attr
, points
, count
)) return FALSE
;
1669 return NtGdiPolyPolyDraw( hdc
, points
, &count
, 1, NtGdiPolyBezier
);
1672 /******************************************************************************
1673 * PolyBezierTo (GDI32.@)
1675 BOOL WINAPI
PolyBezierTo( HDC hdc
, const POINT
*points
, DWORD count
)
1679 TRACE( "%p, %p, %lu\n", hdc
, points
, count
);
1681 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1682 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1683 if (dc_attr
->emf
&& !EMFDC_PolyBezierTo( dc_attr
, points
, count
)) return FALSE
;
1684 return NtGdiPolyPolyDraw( hdc
, points
, &count
, 1, NtGdiPolyBezierTo
);
1687 /**********************************************************************
1688 * PolylineTo (GDI32.@)
1690 BOOL WINAPI
PolylineTo( HDC hdc
, const POINT
*points
, DWORD count
)
1694 TRACE( "%p, %p, %lu\n", hdc
, points
, count
);
1696 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1697 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1698 if (dc_attr
->emf
&& !EMFDC_PolylineTo( dc_attr
, points
, count
)) return FALSE
;
1699 return NtGdiPolyPolyDraw( hdc
, points
, &count
, 1, NtGdiPolylineTo
);
1702 /***********************************************************************
1703 * PolyDraw (GDI32.@)
1705 BOOL WINAPI
PolyDraw( HDC hdc
, const POINT
*points
, const BYTE
*types
, DWORD count
)
1709 TRACE( "%p, %p, %p, %lu\n", hdc
, points
, types
, count
);
1711 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1712 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1713 if (dc_attr
->emf
&& !EMFDC_PolyDraw( dc_attr
, points
, types
, count
)) return FALSE
;
1714 return NtGdiPolyDraw( hdc
, points
, types
, count
);
1717 /***********************************************************************
1720 BOOL WINAPI
FillRgn( HDC hdc
, HRGN hrgn
, HBRUSH hbrush
)
1724 TRACE( "%p, %p, %p\n", hdc
, hrgn
, hbrush
);
1726 if (is_meta_dc( hdc
)) return METADC_FillRgn( hdc
, hrgn
, hbrush
);
1727 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1728 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1729 if (dc_attr
->emf
&& !EMFDC_FillRgn( dc_attr
, hrgn
, hbrush
)) return FALSE
;
1730 return NtGdiFillRgn( hdc
, hrgn
, hbrush
);
1733 /***********************************************************************
1734 * PaintRgn (GDI32.@)
1736 BOOL WINAPI
PaintRgn( HDC hdc
, HRGN hrgn
)
1740 TRACE( "%p, %p\n", hdc
, hrgn
);
1742 if (is_meta_dc( hdc
)) return METADC_PaintRgn( hdc
, hrgn
);
1743 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1744 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1745 if (dc_attr
->emf
&& !EMFDC_PaintRgn( dc_attr
, hrgn
)) return FALSE
;
1746 return NtGdiFillRgn( hdc
, hrgn
, GetCurrentObject( hdc
, OBJ_BRUSH
));
1749 /***********************************************************************
1750 * FrameRgn (GDI32.@)
1752 BOOL WINAPI
FrameRgn( HDC hdc
, HRGN hrgn
, HBRUSH hbrush
, INT width
, INT height
)
1756 TRACE( "%p, %p, %p, %dx%d\n", hdc
, hrgn
, hbrush
, width
, height
);
1758 if (is_meta_dc( hdc
)) return METADC_FrameRgn( hdc
, hrgn
, hbrush
, width
, height
);
1759 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1760 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1761 if (dc_attr
->emf
&& !EMFDC_FrameRgn( dc_attr
, hrgn
, hbrush
, width
, height
))
1763 return NtGdiFrameRgn( hdc
, hrgn
, hbrush
, width
, height
);
1766 /***********************************************************************
1767 * InvertRgn (GDI32.@)
1769 BOOL WINAPI
InvertRgn( HDC hdc
, HRGN hrgn
)
1773 TRACE( "%p, %p\n", hdc
, hrgn
);
1775 if (is_meta_dc( hdc
)) return METADC_InvertRgn( hdc
, hrgn
);
1776 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1777 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1778 if (dc_attr
->emf
&& !EMFDC_InvertRgn( dc_attr
, hrgn
)) return FALSE
;
1779 return NtGdiInvertRgn( hdc
, hrgn
);
1782 /***********************************************************************
1783 * ExtFloodFill (GDI32.@)
1785 BOOL WINAPI
ExtFloodFill( HDC hdc
, INT x
, INT y
, COLORREF color
, UINT fill_type
)
1789 TRACE( "%p, (%d, %d), %08lx, %x\n", hdc
, x
, y
, color
, fill_type
);
1791 if (is_meta_dc( hdc
)) return METADC_ExtFloodFill( hdc
, x
, y
, color
, fill_type
);
1792 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1793 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1794 if (dc_attr
->emf
&& !EMFDC_ExtFloodFill( dc_attr
, x
, y
, color
, fill_type
)) return FALSE
;
1795 return NtGdiExtFloodFill( hdc
, x
, y
, color
, fill_type
);
1798 /***********************************************************************
1799 * FloodFill (GDI32.@)
1801 BOOL WINAPI
FloodFill( HDC hdc
, INT x
, INT y
, COLORREF color
)
1803 return ExtFloodFill( hdc
, x
, y
, color
, FLOODFILLBORDER
);
1806 /******************************************************************************
1807 * GdiGradientFill (GDI32.@)
1809 BOOL WINAPI
GdiGradientFill( HDC hdc
, TRIVERTEX
*vert_array
, ULONG nvert
,
1810 void *grad_array
, ULONG ngrad
, ULONG mode
)
1814 TRACE( "%p vert_array:%p nvert:%ld grad_array:%p ngrad:%ld\n", hdc
, vert_array
,
1815 nvert
, grad_array
, ngrad
);
1817 if (!(dc_attr
= get_dc_attr( hdc
)))
1819 SetLastError( ERROR_INVALID_PARAMETER
);
1822 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1824 !EMFDC_GradientFill( dc_attr
, vert_array
, nvert
, grad_array
, ngrad
, mode
))
1826 return NtGdiGradientFill( hdc
, vert_array
, nvert
, grad_array
, ngrad
, mode
);
1829 /***********************************************************************
1830 * SetTextJustification (GDI32.@)
1832 BOOL WINAPI
SetTextJustification( HDC hdc
, INT extra
, INT breaks
)
1836 if (is_meta_dc( hdc
)) return METADC_SetTextJustification( hdc
, extra
, breaks
);
1837 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1838 if (dc_attr
->emf
&& !EMFDC_SetTextJustification( dc_attr
, extra
, breaks
))
1840 return NtGdiSetTextJustification( hdc
, extra
, breaks
);
1843 /***********************************************************************
1846 BOOL WINAPI
PatBlt( HDC hdc
, INT left
, INT top
, INT width
, INT height
, DWORD rop
)
1850 if (is_meta_dc( hdc
)) return METADC_PatBlt( hdc
, left
, top
, width
, height
, rop
);
1851 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1852 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1853 if (dc_attr
->emf
&& !EMFDC_PatBlt( dc_attr
, left
, top
, width
, height
, rop
))
1855 return NtGdiPatBlt( hdc
, left
, top
, width
, height
, rop
);
1858 /***********************************************************************
1861 BOOL WINAPI DECLSPEC_HOTPATCH
BitBlt( HDC hdc_dst
, INT x_dst
, INT y_dst
, INT width
, INT height
,
1862 HDC hdc_src
, INT x_src
, INT y_src
, DWORD rop
)
1866 if (is_meta_dc( hdc_dst
)) return METADC_BitBlt( hdc_dst
, x_dst
, y_dst
, width
, height
,
1867 hdc_src
, x_src
, y_src
, rop
);
1868 if (!(dc_attr
= get_dc_attr( hdc_dst
))) return FALSE
;
1869 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1870 if (dc_attr
->emf
&& !EMFDC_BitBlt( dc_attr
, x_dst
, y_dst
, width
, height
,
1871 hdc_src
, x_src
, y_src
, rop
))
1873 return NtGdiBitBlt( hdc_dst
, x_dst
, y_dst
, width
, height
,
1874 hdc_src
, x_src
, y_src
, rop
, 0 /* FIXME */, 0 /* FIXME */ );
1877 /***********************************************************************
1878 * StretchBlt (GDI32.@)
1880 BOOL WINAPI
StretchBlt( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
, INT height_dst
,
1881 HDC hdc_src
, INT x_src
, INT y_src
, INT width_src
, INT height_src
,
1886 if (is_meta_dc( hdc
)) return METADC_StretchBlt( hdc
, x_dst
, y_dst
, width_dst
, height_dst
,
1887 hdc_src
, x_src
, y_src
, width_src
,
1889 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1890 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1891 if (dc_attr
->emf
&& !EMFDC_StretchBlt( dc_attr
, x_dst
, y_dst
, width_dst
, height_dst
,
1892 hdc_src
, x_src
, y_src
, width_src
,
1895 return NtGdiStretchBlt( hdc
, x_dst
, y_dst
, width_dst
, height_dst
,
1896 hdc_src
, x_src
, y_src
, width_src
,
1897 height_src
, rop
, 0 /* FIXME */ );
1900 /***********************************************************************
1903 BOOL WINAPI
MaskBlt( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
, INT height_dst
,
1904 HDC hdc_src
, INT x_src
, INT y_src
, HBITMAP mask
,
1905 INT x_mask
, INT y_mask
, DWORD rop
)
1909 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1910 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1911 if (dc_attr
->emf
&& !EMFDC_MaskBlt( dc_attr
, x_dst
, y_dst
, width_dst
, height_dst
,
1912 hdc_src
, x_src
, y_src
, mask
, x_mask
, y_mask
, rop
))
1914 return NtGdiMaskBlt( hdc
, x_dst
, y_dst
, width_dst
, height_dst
, hdc_src
, x_src
, y_src
,
1915 mask
, x_mask
, y_mask
, rop
, 0 /* FIXME */ );
1918 /***********************************************************************
1921 BOOL WINAPI
PlgBlt( HDC hdc
, const POINT
*points
, HDC hdc_src
, INT x_src
, INT y_src
,
1922 INT width
, INT height
, HBITMAP mask
, INT x_mask
, INT y_mask
)
1926 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1927 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1928 if (dc_attr
->emf
&& !EMFDC_PlgBlt( dc_attr
, points
, hdc_src
, x_src
, y_src
,
1929 width
, height
, mask
, x_mask
, y_mask
))
1931 return NtGdiPlgBlt( hdc
, points
, hdc_src
, x_src
, y_src
, width
, height
,
1932 mask
, x_mask
, y_mask
, 0 /* FIXME */ );
1935 /******************************************************************************
1936 * GdiTransparentBlt (GDI32.@)
1938 BOOL WINAPI
GdiTransparentBlt( HDC hdc
, int x_dst
, int y_dst
, int width_dst
, int height_dst
,
1939 HDC hdc_src
, int x_src
, int y_src
, int width_src
, int height_src
,
1944 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
1945 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1946 if (dc_attr
->emf
&& !EMFDC_TransparentBlt( dc_attr
, x_dst
, y_dst
, width_dst
, height_dst
, hdc_src
,
1947 x_src
, y_src
, width_src
, height_src
, color
))
1949 return NtGdiTransparentBlt( hdc
, x_dst
, y_dst
, width_dst
, height_dst
, hdc_src
, x_src
, y_src
,
1950 width_src
, height_src
, color
);
1953 /******************************************************************************
1954 * GdiAlphaBlend (GDI32.@)
1956 BOOL WINAPI
GdiAlphaBlend( HDC hdc_dst
, int x_dst
, int y_dst
, int width_dst
, int height_dst
,
1957 HDC hdc_src
, int x_src
, int y_src
, int width_src
, int height_src
,
1958 BLENDFUNCTION blend_function
)
1962 if (!(dc_attr
= get_dc_attr( hdc_dst
))) return FALSE
;
1963 if (dc_attr
->print
) print_call_start_page( dc_attr
);
1964 if (dc_attr
->emf
&& !EMFDC_AlphaBlend( dc_attr
, x_dst
, y_dst
, width_dst
, height_dst
,
1965 hdc_src
, x_src
, y_src
, width_src
,
1966 height_src
, blend_function
))
1968 return NtGdiAlphaBlend( hdc_dst
, x_dst
, y_dst
, width_dst
, height_dst
,
1969 hdc_src
, x_src
, y_src
, width_src
, height_src
,
1970 *(DWORD
*)&blend_function
, 0 /* FIXME */ );
1973 /******************************************************************************
1974 * SetDIBits (GDI32.@)
1976 * Sets pixels in a bitmap using colors from DIB.
1978 INT WINAPI
SetDIBits( HDC hdc
, HBITMAP hbitmap
, UINT startscan
,
1979 UINT lines
, const void *bits
, const BITMAPINFO
*info
,
1982 /* Wine-specific: pass hbitmap to NtGdiSetDIBitsToDeviceInternal */
1983 return NtGdiSetDIBitsToDeviceInternal( hdc
, 0, 0, 0, 0, 0, 0,
1984 startscan
, lines
, bits
, info
, coloruse
,
1985 0, 0, FALSE
, hbitmap
);
1988 /***********************************************************************
1989 * SetDIBitsToDevice (GDI32.@)
1991 INT WINAPI
SetDIBitsToDevice( HDC hdc
, INT x_dst
, INT y_dst
, DWORD cx
,
1992 DWORD cy
, INT x_src
, INT y_src
, UINT startscan
,
1993 UINT lines
, const void *bits
, const BITMAPINFO
*bmi
,
1998 if (is_meta_dc( hdc
))
1999 return METADC_SetDIBitsToDevice( hdc
, x_dst
, y_dst
, cx
, cy
, x_src
, y_src
, startscan
,
2000 lines
, bits
, bmi
, coloruse
);
2001 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2002 if (dc_attr
->print
) print_call_start_page( dc_attr
);
2003 if (dc_attr
->emf
&& !EMFDC_SetDIBitsToDevice( dc_attr
, x_dst
, y_dst
, cx
, cy
, x_src
, y_src
,
2004 startscan
, lines
, bits
, bmi
, coloruse
))
2006 return NtGdiSetDIBitsToDeviceInternal( hdc
, x_dst
, y_dst
, cx
, cy
, x_src
, y_src
,
2007 startscan
, lines
, bits
, bmi
, coloruse
,
2008 0, 0, FALSE
, NULL
);
2011 /***********************************************************************
2012 * StretchDIBits (GDI32.@)
2014 INT WINAPI DECLSPEC_HOTPATCH
StretchDIBits( HDC hdc
, INT x_dst
, INT y_dst
, INT width_dst
,
2015 INT height_dst
, INT x_src
, INT y_src
, INT width_src
,
2016 INT height_src
, const void *bits
, const BITMAPINFO
*bmi
,
2017 UINT coloruse
, DWORD rop
)
2021 if (is_meta_dc( hdc
))
2022 return METADC_StretchDIBits( hdc
, x_dst
, y_dst
, width_dst
, height_dst
, x_src
, y_src
,
2023 width_src
, height_src
, bits
, bmi
, coloruse
, rop
);
2024 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2025 if (dc_attr
->print
) print_call_start_page( dc_attr
);
2026 if (dc_attr
->emf
&& !EMFDC_StretchDIBits( dc_attr
, x_dst
, y_dst
, width_dst
, height_dst
,
2027 x_src
, y_src
, width_src
, height_src
, bits
,
2028 bmi
, coloruse
, rop
))
2030 return NtGdiStretchDIBitsInternal( hdc
, x_dst
, y_dst
, width_dst
, height_dst
, x_src
, y_src
,
2031 width_src
, height_src
, bits
, bmi
, coloruse
, rop
,
2035 /***********************************************************************
2036 * BeginPath (GDI32.@)
2038 BOOL WINAPI
BeginPath(HDC hdc
)
2042 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2043 if (dc_attr
->emf
&& !EMFDC_BeginPath( dc_attr
)) return FALSE
;
2044 return NtGdiBeginPath( hdc
);
2047 /***********************************************************************
2050 BOOL WINAPI
EndPath(HDC hdc
)
2054 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2055 if (dc_attr
->emf
&& !EMFDC_EndPath( dc_attr
)) return FALSE
;
2056 return NtGdiEndPath( hdc
);
2059 /***********************************************************************
2060 * AbortPath (GDI32.@)
2062 BOOL WINAPI
AbortPath( HDC hdc
)
2066 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2067 if (dc_attr
->emf
&& !EMFDC_AbortPath( dc_attr
)) return FALSE
;
2068 return NtGdiAbortPath( hdc
);
2071 /***********************************************************************
2072 * CloseFigure (GDI32.@)
2074 BOOL WINAPI
CloseFigure( HDC hdc
)
2078 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2079 if (dc_attr
->emf
&& !EMFDC_CloseFigure( dc_attr
)) return FALSE
;
2080 return NtGdiCloseFigure( hdc
);
2083 /***********************************************************************
2084 * FillPath (GDI32.@)
2086 BOOL WINAPI
FillPath( HDC hdc
)
2090 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2091 if (dc_attr
->print
) print_call_start_page( dc_attr
);
2092 if (dc_attr
->emf
&& !EMFDC_FillPath( dc_attr
)) return FALSE
;
2093 return NtGdiFillPath( hdc
);
2096 /*******************************************************************
2097 * StrokeAndFillPath (GDI32.@)
2099 BOOL WINAPI
StrokeAndFillPath( HDC hdc
)
2103 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2104 if (dc_attr
->print
) print_call_start_page( dc_attr
);
2105 if (dc_attr
->emf
&& !EMFDC_StrokeAndFillPath( dc_attr
)) return FALSE
;
2106 return NtGdiStrokeAndFillPath( hdc
);
2109 /*******************************************************************
2110 * StrokePath (GDI32.@)
2112 BOOL WINAPI
StrokePath( HDC hdc
)
2116 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2117 if (dc_attr
->print
) print_call_start_page( dc_attr
);
2118 if (dc_attr
->emf
&& !EMFDC_StrokePath( dc_attr
)) return FALSE
;
2119 return NtGdiStrokePath( hdc
);
2122 /***********************************************************************
2123 * FlattenPath (GDI32.@)
2125 BOOL WINAPI
FlattenPath( HDC hdc
)
2129 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2130 if (dc_attr
->emf
&& !EMFDC_FlattenPath( dc_attr
)) return FALSE
;
2131 return NtGdiFlattenPath( hdc
);
2134 /***********************************************************************
2135 * WidenPath (GDI32.@)
2137 BOOL WINAPI
WidenPath( HDC hdc
)
2141 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2142 if (dc_attr
->emf
&& !EMFDC_WidenPath( dc_attr
)) return FALSE
;
2143 return NtGdiWidenPath( hdc
);
2146 /***********************************************************************
2147 * SelectClipPath (GDI32.@)
2149 BOOL WINAPI
SelectClipPath( HDC hdc
, INT mode
)
2153 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2154 if (dc_attr
->emf
&& !EMFDC_SelectClipPath( dc_attr
, mode
)) return FALSE
;
2155 return NtGdiSelectClipPath( hdc
, mode
);
2158 /***********************************************************************
2159 * GetClipRgn (GDI32.@)
2161 INT WINAPI
GetClipRgn( HDC hdc
, HRGN rgn
)
2163 return NtGdiGetRandomRgn( hdc
, rgn
, NTGDI_RGN_MIRROR_RTL
| 1 );
2166 /***********************************************************************
2167 * GetMetaRgn (GDI32.@)
2169 INT WINAPI
GetMetaRgn( HDC hdc
, HRGN rgn
)
2171 return NtGdiGetRandomRgn( hdc
, rgn
, NTGDI_RGN_MIRROR_RTL
| 2 );
2174 /***********************************************************************
2175 * IntersectClipRect (GDI32.@)
2177 INT WINAPI
IntersectClipRect( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
)
2181 TRACE("%p %d,%d - %d,%d\n", hdc
, left
, top
, right
, bottom
);
2183 if (is_meta_dc( hdc
)) return METADC_IntersectClipRect( hdc
, left
, top
, right
, bottom
);
2184 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2185 if (dc_attr
->emf
&& !EMFDC_IntersectClipRect( dc_attr
, left
, top
, right
, bottom
))
2187 return NtGdiIntersectClipRect( hdc
, left
, top
, right
, bottom
);
2190 /***********************************************************************
2191 * OffsetClipRgn (GDI32.@)
2193 INT WINAPI
OffsetClipRgn( HDC hdc
, INT x
, INT y
)
2197 if (is_meta_dc( hdc
)) return METADC_OffsetClipRgn( hdc
, x
, y
);
2198 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2199 if (dc_attr
->emf
&& !EMFDC_OffsetClipRgn( dc_attr
, x
, y
)) return FALSE
;
2200 return NtGdiOffsetClipRgn( hdc
, x
, y
);
2203 /***********************************************************************
2204 * ExcludeClipRect (GDI32.@)
2206 INT WINAPI
ExcludeClipRect( HDC hdc
, INT left
, INT top
, INT right
, INT bottom
)
2210 if (is_meta_dc( hdc
)) return METADC_ExcludeClipRect( hdc
, left
, top
, right
, bottom
);
2211 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2212 if (dc_attr
->emf
&& !EMFDC_ExcludeClipRect( dc_attr
, left
, top
, right
, bottom
))
2214 return NtGdiExcludeClipRect( hdc
, left
, top
, right
, bottom
);
2217 /******************************************************************************
2218 * ExtSelectClipRgn (GDI32.@)
2220 INT WINAPI
ExtSelectClipRgn( HDC hdc
, HRGN hrgn
, INT mode
)
2224 TRACE("%p %p %d\n", hdc
, hrgn
, mode
);
2226 if (is_meta_dc( hdc
)) return METADC_ExtSelectClipRgn( hdc
, hrgn
, mode
);
2227 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2228 if (dc_attr
->emf
&& !EMFDC_ExtSelectClipRgn( dc_attr
, hrgn
, mode
))
2230 return NtGdiExtSelectClipRgn( hdc
, hrgn
, mode
);
2233 /***********************************************************************
2234 * SelectClipRgn (GDI32.@)
2236 INT WINAPI
SelectClipRgn( HDC hdc
, HRGN hrgn
)
2238 return ExtSelectClipRgn( hdc
, hrgn
, RGN_COPY
);
2241 /***********************************************************************
2242 * SetMetaRgn (GDI32.@)
2244 INT WINAPI
SetMetaRgn( HDC hdc
)
2248 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2249 if (dc_attr
->emf
) FIXME( "EMFs are not yet supported\n" );
2250 return NtGdiSetMetaRgn( hdc
);
2253 /***********************************************************************
2256 BOOL WINAPI
DPtoLP( HDC hdc
, POINT
*points
, INT count
)
2258 return NtGdiTransformPoints( hdc
, points
, points
, count
, NtGdiDPtoLP
);
2261 /***********************************************************************
2264 BOOL WINAPI
LPtoDP( HDC hdc
, POINT
*points
, INT count
)
2266 return NtGdiTransformPoints( hdc
, points
, points
, count
, NtGdiLPtoDP
);
2269 /***********************************************************************
2270 * ScaleViewportExtEx (GDI32.@)
2272 BOOL WINAPI
ScaleViewportExtEx( HDC hdc
, INT x_num
, INT x_denom
,
2273 INT y_num
, INT y_denom
, SIZE
*size
)
2277 if (is_meta_dc( hdc
)) return METADC_ScaleViewportExtEx( hdc
, x_num
, x_denom
, y_num
, y_denom
);
2278 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2279 if (dc_attr
->emf
&& !EMFDC_ScaleViewportExtEx( dc_attr
, x_num
, x_denom
, y_num
, y_denom
))
2281 return NtGdiScaleViewportExtEx( hdc
, x_num
, x_denom
, y_num
, y_denom
, size
);
2284 /***********************************************************************
2285 * ScaleWindowExtEx (GDI32.@)
2287 BOOL WINAPI
ScaleWindowExtEx( HDC hdc
, INT x_num
, INT x_denom
,
2288 INT y_num
, INT y_denom
, SIZE
*size
)
2292 if (is_meta_dc( hdc
)) return METADC_ScaleWindowExtEx( hdc
, x_num
, x_denom
, y_num
, y_denom
);
2293 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2294 if (dc_attr
->emf
&& !EMFDC_ScaleWindowExtEx( dc_attr
, x_num
, x_denom
, y_num
, y_denom
))
2296 return NtGdiScaleWindowExtEx( hdc
, x_num
, x_denom
, y_num
, y_denom
, size
);
2299 static UINT WINAPI
realize_palette( HDC hdc
)
2301 return NtUserRealizePalette( hdc
);
2304 /* Pointers to USER implementation of SelectPalette/RealizePalette */
2305 /* they will be patched by USER on startup */
2306 HPALETTE (WINAPI
*pfnSelectPalette
)( HDC hdc
, HPALETTE hpal
, WORD bkgnd
) = NtUserSelectPalette
;
2307 UINT (WINAPI
*pfnRealizePalette
)( HDC hdc
) = realize_palette
;
2309 /***********************************************************************
2310 * SelectPalette (GDI32.@)
2312 HPALETTE WINAPI
SelectPalette( HDC hdc
, HPALETTE palette
, BOOL force_background
)
2316 palette
= get_full_gdi_handle( palette
);
2317 if (is_meta_dc( hdc
)) return ULongToHandle( METADC_SelectPalette( hdc
, palette
) );
2318 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2319 if (dc_attr
->emf
&& !EMFDC_SelectPalette( dc_attr
, palette
)) return 0;
2320 return pfnSelectPalette( hdc
, palette
, force_background
);
2323 /***********************************************************************
2324 * RealizePalette (GDI32.@)
2326 UINT WINAPI
RealizePalette( HDC hdc
)
2330 if (is_meta_dc( hdc
)) return METADC_RealizePalette( hdc
);
2331 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2332 if (dc_attr
->emf
&& !EMFDC_RealizePalette( dc_attr
)) return 0;
2333 return pfnRealizePalette( hdc
);
2336 /***********************************************************************
2337 * GdiSetPixelFormat (GDI32.@)
2339 BOOL WINAPI
GdiSetPixelFormat( HDC hdc
, INT format
, const PIXELFORMATDESCRIPTOR
*descr
)
2341 TRACE( "(%p,%d,%p)\n", hdc
, format
, descr
);
2342 return NtGdiSetPixelFormat( hdc
, format
);
2345 /***********************************************************************
2346 * CancelDC (GDI32.@)
2348 BOOL WINAPI
CancelDC(HDC hdc
)
2354 /***********************************************************************
2355 * StartDocW [GDI32.@]
2357 * StartDoc calls the STARTDOC Escape with the input data pointing to DocName
2358 * and the output data (which is used as a second input parameter).pointing at
2359 * the whole docinfo structure. This seems to be an undocumented feature of
2360 * the STARTDOC Escape.
2362 * Note: we now do it the other way, with the STARTDOC Escape calling StartDoc.
2364 INT WINAPI
StartDocW( HDC hdc
, const DOCINFOW
*doc
)
2366 DOC_INFO_1W spool_info
;
2367 WCHAR
*output
= NULL
;
2368 struct print
*print
;
2374 TRACE("%p %p\n", hdc
, doc
);
2382 memset( &info
, 0, sizeof(info
) );
2383 info
.cbSize
= sizeof(info
);
2386 TRACE("DocName %s, Output %s, Datatype %s, fwType %#lx\n",
2387 debugstr_w(info
.lpszDocName
), debugstr_w(info
.lpszOutput
),
2388 debugstr_w(info
.lpszDatatype
), info
.fwType
);
2390 if (!(dc_attr
= get_dc_attr( hdc
))) return SP_ERROR
;
2391 if (dc_attr
->print
&& dc_attr
->emf
) return SP_ERROR
;
2393 proc
= (ABORTPROC
)(UINT_PTR
)dc_attr
->abort_proc
;
2394 if (proc
&& !proc( hdc
, 0 )) return 0;
2396 print
= get_dc_print( dc_attr
);
2399 if (!info
.lpszOutput
) info
.lpszOutput
= print
->output
;
2400 output
= StartDocDlgW( print
->printer
, &info
);
2401 if (output
) info
.lpszOutput
= output
;
2403 if (!info
.lpszDatatype
|| !wcsicmp(info
.lpszDatatype
, L
"EMF"))
2405 spool_info
.pDocName
= (WCHAR
*)info
.lpszDocName
;
2406 spool_info
.pOutputFile
= (WCHAR
*)info
.lpszOutput
;
2407 spool_info
.pDatatype
= (WCHAR
*)L
"NT EMF 1.003";
2408 if ((ret
= StartDocPrinterW( print
->printer
, 1, (BYTE
*)&spool_info
)))
2410 if (!spool_start_doc( dc_attr
, print
->printer
, &info
))
2415 HeapFree( GetProcessHeap(), 0, output
);
2416 print
->flags
|= CALL_START_PAGE
;
2422 ret
= NtGdiStartDoc( hdc
, &info
, NULL
, 0 );
2423 HeapFree( GetProcessHeap(), 0, output
);
2424 if (ret
&& print
) print
->flags
|= CALL_START_PAGE
;
2428 /***********************************************************************
2429 * StartDocA [GDI32.@]
2431 INT WINAPI
StartDocA( HDC hdc
, const DOCINFOA
*doc
)
2433 WCHAR
*doc_name
= NULL
, *output
= NULL
, *data_type
= NULL
;
2437 if (!doc
) return StartDocW(hdc
, NULL
);
2439 docW
.cbSize
= doc
->cbSize
;
2440 if (doc
->lpszDocName
)
2442 len
= MultiByteToWideChar( CP_ACP
, 0, doc
->lpszDocName
, -1, NULL
, 0 );
2443 doc_name
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) );
2444 MultiByteToWideChar( CP_ACP
, 0, doc
->lpszDocName
, -1, doc_name
, len
);
2446 if (doc
->lpszOutput
)
2448 len
= MultiByteToWideChar( CP_ACP
, 0, doc
->lpszOutput
, -1, NULL
, 0 );
2449 output
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) );
2450 MultiByteToWideChar( CP_ACP
, 0, doc
->lpszOutput
, -1, output
, len
);
2452 if (doc
->lpszDatatype
)
2454 len
= MultiByteToWideChar( CP_ACP
, 0, doc
->lpszDatatype
, -1, NULL
, 0);
2455 data_type
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) );
2456 MultiByteToWideChar( CP_ACP
, 0, doc
->lpszDatatype
, -1, data_type
, len
);
2459 docW
.lpszDocName
= doc_name
;
2460 docW
.lpszOutput
= output
;
2461 docW
.lpszDatatype
= data_type
;
2462 docW
.fwType
= doc
->fwType
;
2464 ret
= StartDocW(hdc
, &docW
);
2466 HeapFree( GetProcessHeap(), 0, doc_name
);
2467 HeapFree( GetProcessHeap(), 0, output
);
2468 HeapFree( GetProcessHeap(), 0, data_type
);
2472 /***********************************************************************
2473 * StartPage (GDI32.@)
2475 INT WINAPI
StartPage( HDC hdc
)
2477 struct print
*print
;
2480 if (!(dc_attr
= get_dc_attr( hdc
))) return SP_ERROR
;
2481 print
= get_dc_print( dc_attr
);
2484 print
->flags
= (print
->flags
& ~CALL_START_PAGE
) | CALL_END_PAGE
;
2486 return spool_start_page( dc_attr
, print
->printer
);
2488 return NtGdiStartPage( hdc
);
2491 /***********************************************************************
2494 INT WINAPI
EndPage( HDC hdc
)
2496 struct print
*print
;
2499 if (!(dc_attr
= get_dc_attr( hdc
))) return SP_ERROR
;
2500 print
= get_dc_print( dc_attr
);
2503 BOOL write
= print
->flags
& WRITE_DEVMODE
;
2505 if (!(print
->flags
& CALL_END_PAGE
)) return SP_ERROR
;
2506 print
->flags
= (print
->flags
& ~(CALL_END_PAGE
| WRITE_DEVMODE
)) | CALL_START_PAGE
;
2508 return spool_end_page( dc_attr
, print
->printer
, print
->devmode
, write
);
2510 return NtGdiEndPage( hdc
);
2513 /***********************************************************************
2516 INT WINAPI
EndDoc( HDC hdc
)
2518 struct print
*print
;
2521 if (!(dc_attr
= get_dc_attr( hdc
))) return SP_ERROR
;
2522 print
= get_dc_print( dc_attr
);
2525 if (print
->flags
& CALL_END_PAGE
) EndPage( hdc
);
2526 print
->flags
&= ~CALL_START_PAGE
;
2528 return spool_end_doc( dc_attr
, print
->printer
);
2530 return NtGdiEndDoc( hdc
);
2533 /***********************************************************************
2534 * AbortDoc (GDI32.@)
2536 INT WINAPI
AbortDoc( HDC hdc
)
2538 struct print
*print
;
2541 if (!(dc_attr
= get_dc_attr( hdc
))) return SP_ERROR
;
2542 print
= get_dc_print( dc_attr
);
2545 print
->flags
&= ~(CALL_START_PAGE
| CALL_END_PAGE
);
2547 return spool_abort_doc( dc_attr
, print
->printer
);
2549 return NtGdiAbortDoc( hdc
);
2552 /**********************************************************************
2553 * SetAbortProc (GDI32.@)
2555 INT WINAPI
SetAbortProc( HDC hdc
, ABORTPROC abrtprc
)
2559 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2560 dc_attr
->abort_proc
= (UINT_PTR
)abrtprc
;
2564 /***********************************************************************
2565 * SetICMMode (GDI32.@)
2567 INT WINAPI
SetICMMode( HDC hdc
, INT mode
)
2569 /* FIXME: Assume that ICM is always off, and cannot be turned on */
2572 case ICM_OFF
: return ICM_OFF
;
2573 case ICM_ON
: return 0;
2574 case ICM_QUERY
: return ICM_OFF
;
2579 /***********************************************************************
2580 * GdiIsMetaPrintDC (GDI32.@)
2582 BOOL WINAPI
GdiIsMetaPrintDC( HDC hdc
)
2586 TRACE( "%p\n", hdc
);
2588 if (!(dc_attr
= get_dc_attr( hdc
))) return FALSE
;
2589 return dc_attr
->print
&& dc_attr
->emf
;
2592 /***********************************************************************
2593 * GdiIsMetaFileDC (GDI32.@)
2595 BOOL WINAPI
GdiIsMetaFileDC( HDC hdc
)
2597 TRACE( "%p\n", hdc
);
2599 switch (GetObjectType( hdc
))
2608 /***********************************************************************
2609 * GdiIsPlayMetafileDC (GDI32.@)
2611 BOOL WINAPI
GdiIsPlayMetafileDC( HDC hdc
)
2613 FIXME( "%p\n", hdc
);
2617 /*******************************************************************
2618 * DrawEscape (GDI32.@)
2620 INT WINAPI
DrawEscape( HDC hdc
, INT escape
, INT input_size
, const char *input
)
2626 /*******************************************************************
2627 * NamedEscape (GDI32.@)
2629 INT WINAPI
NamedEscape( HDC hdc
, const WCHAR
*driver
, INT escape
, INT input_size
,
2630 const char *input
, INT output_size
, char *output
)
2632 FIXME( "(%p %s %d, %d %p %d %p)\n", hdc
, wine_dbgstr_w(driver
), escape
, input_size
,
2633 input
, output_size
, output
);
2637 /*******************************************************************
2638 * DdQueryDisplaySettingsUniqueness (GDI32.@)
2641 ULONG WINAPI
DdQueryDisplaySettingsUniqueness(void)
2643 static int warn_once
;
2644 if (!warn_once
++) FIXME( "stub\n" );