usp10: Implement GPOS MarkToBase.
[wine] / dlls / gdi32 / driver.c
1 /*
2  * Graphics driver management functions
3  *
4  * Copyright 1994 Bob Amstadt
5  * Copyright 1996, 2001 Alexandre Julliard
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include "config.h"
23 #include "wine/port.h"
24
25 #include <assert.h>
26 #include <stdarg.h>
27 #include <string.h>
28 #include <stdio.h>
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winreg.h"
32 #include "ddrawgdi.h"
33 #include "wine/winbase16.h"
34
35 #include "gdi_private.h"
36 #include "wine/unicode.h"
37 #include "wine/list.h"
38 #include "wine/debug.h"
39
40 WINE_DEFAULT_DEBUG_CHANNEL(driver);
41
42 struct graphics_driver
43 {
44     struct list                entry;
45     HMODULE                    module;  /* module handle */
46     const struct gdi_dc_funcs *funcs;
47 };
48
49 static struct list drivers = LIST_INIT( drivers );
50 static struct graphics_driver *display_driver;
51
52 const struct gdi_dc_funcs *font_driver = NULL;
53 static const struct wgl_funcs null_wgl_driver;
54
55 static CRITICAL_SECTION driver_section;
56 static CRITICAL_SECTION_DEBUG critsect_debug =
57 {
58     0, 0, &driver_section,
59     { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
60       0, 0, { (DWORD_PTR)(__FILE__ ": driver_section") }
61 };
62 static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
63
64 /**********************************************************************
65  *           create_driver
66  *
67  * Allocate and fill the driver structure for a given module.
68  */
69 static struct graphics_driver *create_driver( HMODULE module )
70 {
71     static const struct gdi_dc_funcs empty_funcs;
72     const struct gdi_dc_funcs *funcs = NULL;
73     struct graphics_driver *driver;
74
75     if (!(driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver)))) return NULL;
76     driver->module = module;
77
78     if (module)
79     {
80         const struct gdi_dc_funcs * (CDECL *wine_get_gdi_driver)( unsigned int version );
81
82         if ((wine_get_gdi_driver = (void *)GetProcAddress( module, "wine_get_gdi_driver" )))
83             funcs = wine_get_gdi_driver( WINE_GDI_DRIVER_VERSION );
84     }
85     if (!funcs) funcs = &empty_funcs;
86     driver->funcs = funcs;
87     return driver;
88 }
89
90
91 /**********************************************************************
92  *           get_display_driver
93  *
94  * Special case for loading the display driver: get the name from the config file
95  */
96 static const struct gdi_dc_funcs *get_display_driver(void)
97 {
98     struct graphics_driver *driver;
99     char buffer[MAX_PATH], libname[32], *name, *next;
100     HMODULE module = 0;
101     HKEY hkey;
102
103     if (display_driver) return display_driver->funcs;  /* already loaded */
104
105     strcpy( buffer, "x11" );  /* default value */
106     /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
107     if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey ))
108     {
109         DWORD type, count = sizeof(buffer);
110         RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count );
111         RegCloseKey( hkey );
112     }
113
114     name = buffer;
115     while (name)
116     {
117         next = strchr( name, ',' );
118         if (next) *next++ = 0;
119
120         snprintf( libname, sizeof(libname), "wine%s.drv", name );
121         if ((module = LoadLibraryA( libname )) != 0) break;
122         name = next;
123     }
124
125     if (!(driver = create_driver( module )))
126     {
127         MESSAGE( "Could not create graphics driver '%s'\n", buffer );
128         FreeLibrary( module );
129         ExitProcess(1);
130     }
131     if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
132     {
133         /* somebody beat us to it */
134         FreeLibrary( driver->module );
135         HeapFree( GetProcessHeap(), 0, driver );
136     }
137     return display_driver->funcs;
138 }
139
140
141 /**********************************************************************
142  *           DRIVER_load_driver
143  */
144 const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name )
145 {
146     HMODULE module;
147     struct graphics_driver *driver, *new_driver;
148     static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
149     static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
150
151     /* display driver is a special case */
152     if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W )) return get_display_driver();
153
154     if ((module = GetModuleHandleW( name )))
155     {
156         if (display_driver && display_driver->module == module) return display_driver->funcs;
157         EnterCriticalSection( &driver_section );
158         LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
159         {
160             if (driver->module == module) goto done;
161         }
162         LeaveCriticalSection( &driver_section );
163     }
164
165     if (!(module = LoadLibraryW( name ))) return NULL;
166
167     if (!(new_driver = create_driver( module )))
168     {
169         FreeLibrary( module );
170         return NULL;
171     }
172
173     /* check if someone else added it in the meantime */
174     EnterCriticalSection( &driver_section );
175     LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
176     {
177         if (driver->module != module) continue;
178         FreeLibrary( module );
179         HeapFree( GetProcessHeap(), 0, new_driver );
180         goto done;
181     }
182     driver = new_driver;
183     list_add_head( &drivers, &driver->entry );
184     TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
185 done:
186     LeaveCriticalSection( &driver_section );
187     return driver->funcs;
188 }
189
190
191 static INT nulldrv_AbortDoc( PHYSDEV dev )
192 {
193     return 0;
194 }
195
196 static BOOL nulldrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
197                          INT xstart, INT ystart, INT xend, INT yend )
198 {
199     return TRUE;
200 }
201
202 static BOOL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
203                            INT xstart, INT ystart, INT xend, INT yend )
204 {
205     return TRUE;
206 }
207
208 static BOOL nulldrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
209 {
210     if (!display_driver || !display_driver->funcs->pCreateCompatibleDC) return TRUE;
211     return display_driver->funcs->pCreateCompatibleDC( NULL, pdev );
212 }
213
214 static BOOL nulldrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
215                               LPCWSTR output, const DEVMODEW *devmode )
216 {
217     assert(0);  /* should never be called */
218     return FALSE;
219 }
220
221 static BOOL nulldrv_DeleteDC( PHYSDEV dev )
222 {
223     assert(0);  /* should never be called */
224     return TRUE;
225 }
226
227 static BOOL nulldrv_DeleteObject( PHYSDEV dev, HGDIOBJ obj )
228 {
229     return TRUE;
230 }
231
232 static INT nulldrv_DescribePixelFormat( PHYSDEV dev, INT format, UINT size, PIXELFORMATDESCRIPTOR * descr )
233 {
234     return 0;
235 }
236
237 static DWORD nulldrv_DeviceCapabilities( LPSTR buffer, LPCSTR device, LPCSTR port,
238                                          WORD cap, LPSTR output, DEVMODEA *devmode )
239 {
240     return -1;
241 }
242
243 static BOOL nulldrv_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
244 {
245     return TRUE;
246 }
247
248 static INT nulldrv_EndDoc( PHYSDEV dev )
249 {
250     return 0;
251 }
252
253 static INT nulldrv_EndPage( PHYSDEV dev )
254 {
255     return 0;
256 }
257
258 static BOOL nulldrv_EnumFonts( PHYSDEV dev, LOGFONTW *logfont, FONTENUMPROCW proc, LPARAM lParam )
259 {
260     return TRUE;
261 }
262
263 static INT nulldrv_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW func, LPARAM lparam )
264 {
265     return -1;
266 }
267
268 static INT nulldrv_ExtDeviceMode( LPSTR buffer, HWND hwnd, DEVMODEA *output, LPSTR device,
269                                   LPSTR port, DEVMODEA *input, LPSTR profile, DWORD mode )
270 {
271     return -1;
272 }
273
274 static INT nulldrv_ExtEscape( PHYSDEV dev, INT escape, INT in_size, const void *in_data,
275                                     INT out_size, void *out_data )
276 {
277     return 0;
278 }
279
280 static BOOL nulldrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
281 {
282     return TRUE;
283 }
284
285 static BOOL nulldrv_FontIsLinked( PHYSDEV dev )
286 {
287     return FALSE;
288 }
289
290 static BOOL nulldrv_GdiComment( PHYSDEV dev, UINT size, const BYTE *data )
291 {
292     return FALSE;
293 }
294
295 static BOOL nulldrv_GdiRealizationInfo( PHYSDEV dev, void *info )
296 {
297     return FALSE;
298 }
299
300 static UINT nulldrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
301 {
302     return DCB_RESET;
303 }
304
305 static BOOL nulldrv_GetCharABCWidths( PHYSDEV dev, UINT first, UINT last, LPABC abc )
306 {
307     return FALSE;
308 }
309
310 static BOOL nulldrv_GetCharABCWidthsI( PHYSDEV dev, UINT first, UINT count, WORD *indices, LPABC abc )
311 {
312     return FALSE;
313 }
314
315 static BOOL nulldrv_GetCharWidth( PHYSDEV dev, UINT first, UINT last, INT *buffer )
316 {
317     return FALSE;
318 }
319
320 static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
321 {
322     switch (cap)  /* return meaningful values for some entries */
323     {
324     case HORZRES:     return 640;
325     case VERTRES:     return 480;
326     case BITSPIXEL:   return 1;
327     case PLANES:      return 1;
328     case NUMCOLORS:   return 2;
329     case ASPECTX:     return 36;
330     case ASPECTY:     return 36;
331     case ASPECTXY:    return 51;
332     case LOGPIXELSX:  return 72;
333     case LOGPIXELSY:  return 72;
334     case SIZEPALETTE: return 2;
335     case TEXTCAPS:    return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
336                               TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER |
337                               TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE);
338     default:          return 0;
339     }
340 }
341
342 static BOOL nulldrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
343 {
344     SetLastError( ERROR_INVALID_PARAMETER );
345     return FALSE;
346 }
347
348 static DWORD nulldrv_GetFontData( PHYSDEV dev, DWORD table, DWORD offset, LPVOID buffer, DWORD length )
349 {
350     return FALSE;
351 }
352
353 static DWORD nulldrv_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphs )
354 {
355     return 0;
356 }
357
358 static DWORD nulldrv_GetGlyphIndices( PHYSDEV dev, LPCWSTR str, INT count, LPWORD indices, DWORD flags )
359 {
360     return GDI_ERROR;
361 }
362
363 static DWORD nulldrv_GetGlyphOutline( PHYSDEV dev, UINT ch, UINT format, LPGLYPHMETRICS metrics,
364                                       DWORD size, LPVOID buffer, const MAT2 *mat )
365 {
366     return GDI_ERROR;
367 }
368
369 static BOOL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename )
370 {
371     return FALSE;
372 }
373
374 static DWORD nulldrv_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits,
375                                struct bitblt_coords *src )
376 {
377     return ERROR_NOT_SUPPORTED;
378 }
379
380 static DWORD nulldrv_GetKerningPairs( PHYSDEV dev, DWORD count, LPKERNINGPAIR pairs )
381 {
382     return 0;
383 }
384
385 static UINT nulldrv_GetOutlineTextMetrics( PHYSDEV dev, UINT size, LPOUTLINETEXTMETRICW otm )
386 {
387     return 0;
388 }
389
390 static INT nulldrv_GetPixelFormat( HDC hdc )
391 {
392     return 0;
393 }
394
395 static UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries )
396 {
397     return 0;
398 }
399
400 static UINT nulldrv_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags )
401 {
402     return DEFAULT_CHARSET;
403 }
404
405 static BOOL nulldrv_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR str, INT count, INT max_ext,
406                                           INT *fit, INT *dx, SIZE *size )
407 {
408     return FALSE;
409 }
410
411 static BOOL nulldrv_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, INT count, INT max_ext,
412                                            INT *fit, INT *dx, SIZE *size )
413 {
414     return FALSE;
415 }
416
417 static INT nulldrv_GetTextFace( PHYSDEV dev, INT size, LPWSTR name )
418 {
419     INT ret = 0;
420     LOGFONTW font;
421     HFONT hfont = GetCurrentObject( dev->hdc, OBJ_FONT );
422
423     if (GetObjectW( hfont, sizeof(font), &font ))
424     {
425         ret = strlenW( font.lfFaceName ) + 1;
426         if (name)
427         {
428             lstrcpynW( name, font.lfFaceName, size );
429             ret = min( size, ret );
430         }
431     }
432     return ret;
433 }
434
435 static BOOL nulldrv_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
436 {
437     return FALSE;
438 }
439
440 static BOOL nulldrv_LineTo( PHYSDEV dev, INT x, INT y )
441 {
442     return TRUE;
443 }
444
445 static BOOL nulldrv_MoveTo( PHYSDEV dev, INT x, INT y )
446 {
447     return TRUE;
448 }
449
450 static BOOL nulldrv_PaintRgn( PHYSDEV dev, HRGN rgn )
451 {
452     return TRUE;
453 }
454
455 static BOOL nulldrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
456 {
457     return TRUE;
458 }
459
460 static BOOL nulldrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
461                          INT xstart, INT ystart, INT xend, INT yend )
462 {
463     return TRUE;
464 }
465
466 static BOOL nulldrv_PolyPolygon( PHYSDEV dev, const POINT *points, const INT *counts, UINT polygons )
467 {
468     return TRUE;
469 }
470
471 static BOOL nulldrv_PolyPolyline( PHYSDEV dev, const POINT *points, const DWORD *counts, DWORD lines )
472 {
473     return TRUE;
474 }
475
476 static BOOL nulldrv_Polygon( PHYSDEV dev, const POINT *points, INT count )
477 {
478     INT counts[1] = { count };
479
480     return PolyPolygon( dev->hdc, points, counts, 1 );
481 }
482
483 static BOOL nulldrv_Polyline( PHYSDEV dev, const POINT *points, INT count )
484 {
485     DWORD counts[1] = { count };
486
487     if (count < 0) return FALSE;
488     return PolyPolyline( dev->hdc, points, counts, 1 );
489 }
490
491 static DWORD nulldrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
492                                const struct gdi_image_bits *bits, struct bitblt_coords *src,
493                                struct bitblt_coords *dst, DWORD rop )
494 {
495     return ERROR_SUCCESS;
496 }
497
498 static UINT nulldrv_RealizeDefaultPalette( PHYSDEV dev )
499 {
500     return 0;
501 }
502
503 static UINT nulldrv_RealizePalette( PHYSDEV dev, HPALETTE palette, BOOL primary )
504 {
505     return 0;
506 }
507
508 static BOOL nulldrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
509 {
510     return TRUE;
511 }
512
513 static HDC nulldrv_ResetDC( PHYSDEV dev, const DEVMODEW *devmode )
514 {
515     return 0;
516 }
517
518 static BOOL nulldrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
519                                INT ell_width, INT ell_height )
520 {
521     return TRUE;
522 }
523
524 static HBITMAP nulldrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
525 {
526     return bitmap;
527 }
528
529 static HBRUSH nulldrv_SelectBrush( PHYSDEV dev, HBRUSH brush, const struct brush_pattern *pattern )
530 {
531     return brush;
532 }
533
534 static HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font )
535 {
536     return 0;
537 }
538
539 static HPALETTE nulldrv_SelectPalette( PHYSDEV dev, HPALETTE palette, BOOL bkgnd )
540 {
541     return palette;
542 }
543
544 static HPEN nulldrv_SelectPen( PHYSDEV dev, HPEN pen, const struct brush_pattern *pattern )
545 {
546     return pen;
547 }
548
549 static INT nulldrv_SetArcDirection( PHYSDEV dev, INT dir )
550 {
551     return dir;
552 }
553
554 static COLORREF nulldrv_SetBkColor( PHYSDEV dev, COLORREF color )
555 {
556     return color;
557 }
558
559 static INT nulldrv_SetBkMode( PHYSDEV dev, INT mode )
560 {
561     return mode;
562 }
563
564 static UINT nulldrv_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
565 {
566     return DCB_RESET;
567 }
568
569 static COLORREF nulldrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
570 {
571     return color;
572 }
573
574 static COLORREF nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
575 {
576     return color;
577 }
578
579 static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
580 {
581 }
582
583 static DWORD nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
584 {
585     return layout;
586 }
587
588 static BOOL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
589 {
590     SetLastError( ERROR_INVALID_PARAMETER );
591     return FALSE;
592 }
593
594 static DWORD nulldrv_SetMapperFlags( PHYSDEV dev, DWORD flags )
595 {
596     return flags;
597 }
598
599 static COLORREF nulldrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
600 {
601     return color;
602 }
603
604 static BOOL nulldrv_SetPixelFormat( PHYSDEV dev, INT format, const PIXELFORMATDESCRIPTOR *descr )
605 {
606     return FALSE;
607 }
608
609 static INT nulldrv_SetPolyFillMode( PHYSDEV dev, INT mode )
610 {
611     return mode;
612 }
613
614 static INT nulldrv_SetROP2( PHYSDEV dev, INT rop )
615 {
616     return rop;
617 }
618
619 static INT nulldrv_SetRelAbs( PHYSDEV dev, INT mode )
620 {
621     return mode;
622 }
623
624 static INT nulldrv_SetStretchBltMode( PHYSDEV dev, INT mode )
625 {
626     return mode;
627 }
628
629 static UINT nulldrv_SetTextAlign( PHYSDEV dev, UINT align )
630 {
631     return align;
632 }
633
634 static INT nulldrv_SetTextCharacterExtra( PHYSDEV dev, INT extra )
635 {
636     return extra;
637 }
638
639 static COLORREF nulldrv_SetTextColor( PHYSDEV dev, COLORREF color )
640 {
641     return color;
642 }
643
644 static BOOL nulldrv_SetTextJustification( PHYSDEV dev, INT extra, INT breaks )
645 {
646     return TRUE;
647 }
648
649 static INT nulldrv_StartDoc( PHYSDEV dev, const DOCINFOW *info )
650 {
651     return 0;
652 }
653
654 static INT nulldrv_StartPage( PHYSDEV dev )
655 {
656     return 1;
657 }
658
659 static BOOL nulldrv_SwapBuffers( PHYSDEV dev )
660 {
661     return TRUE;
662 }
663
664 static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
665 {
666     return FALSE;
667 }
668
669 static BOOL nulldrv_wglCopyContext( struct wgl_context *src, struct wgl_context *dst, UINT mask )
670 {
671     return FALSE;
672 }
673
674 static struct wgl_context *nulldrv_wglCreateContext( HDC hdc )
675 {
676     return 0;
677 }
678
679 static struct wgl_context *nulldrv_wglCreateContextAttribsARB( HDC hdc, struct wgl_context *share_ctx,
680                                                                const int *attribs )
681 {
682     return 0;
683 }
684
685 static void nulldrv_wglDeleteContext( struct wgl_context *context )
686 {
687 }
688
689 static HDC nulldrv_wglGetCurrentDC( struct wgl_context *context )
690 {
691     return 0;
692 }
693
694 static PROC nulldrv_wglGetProcAddress( LPCSTR name )
695 {
696     return NULL;
697 }
698
699 static BOOL nulldrv_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct wgl_context *context )
700 {
701     return FALSE;
702 }
703
704 static BOOL nulldrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
705 {
706     return FALSE;
707 }
708
709 static BOOL nulldrv_wglShareLists( struct wgl_context *org, struct wgl_context *dst )
710 {
711     return FALSE;
712 }
713
714 static const struct wgl_funcs *nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
715 {
716     if (version != WINE_GDI_DRIVER_VERSION)
717     {
718         ERR( "version mismatch, opengl32 wants %u but driver has %u\n", version, WINE_GDI_DRIVER_VERSION );
719         return NULL;
720     }
721     return &null_wgl_driver;
722 }
723
724 const struct gdi_dc_funcs null_driver =
725 {
726     nulldrv_AbortDoc,                   /* pAbortDoc */
727     nulldrv_AbortPath,                  /* pAbortPath */
728     nulldrv_AlphaBlend,                 /* pAlphaBlend */
729     nulldrv_AngleArc,                   /* pAngleArc */
730     nulldrv_Arc,                        /* pArc */
731     nulldrv_ArcTo,                      /* pArcTo */
732     nulldrv_BeginPath,                  /* pBeginPath */
733     nulldrv_BlendImage,                 /* pBlendImage */
734     nulldrv_Chord,                      /* pChord */
735     nulldrv_CloseFigure,                /* pCloseFigure */
736     nulldrv_CreateCompatibleDC,         /* pCreateCompatibleDC */
737     nulldrv_CreateDC,                   /* pCreateDC */
738     nulldrv_DeleteDC,                   /* pDeleteDC */
739     nulldrv_DeleteObject,               /* pDeleteObject */
740     nulldrv_DescribePixelFormat,        /* pDescribePixelFormat */
741     nulldrv_DeviceCapabilities,         /* pDeviceCapabilities */
742     nulldrv_Ellipse,                    /* pEllipse */
743     nulldrv_EndDoc,                     /* pEndDoc */
744     nulldrv_EndPage,                    /* pEndPage */
745     nulldrv_EndPath,                    /* pEndPath */
746     nulldrv_EnumFonts,                  /* pEnumFonts */
747     nulldrv_EnumICMProfiles,            /* pEnumICMProfiles */
748     nulldrv_ExcludeClipRect,            /* pExcludeClipRect */
749     nulldrv_ExtDeviceMode,              /* pExtDeviceMode */
750     nulldrv_ExtEscape,                  /* pExtEscape */
751     nulldrv_ExtFloodFill,               /* pExtFloodFill */
752     nulldrv_ExtSelectClipRgn,           /* pExtSelectClipRgn */
753     nulldrv_ExtTextOut,                 /* pExtTextOut */
754     nulldrv_FillPath,                   /* pFillPath */
755     nulldrv_FillRgn,                    /* pFillRgn */
756     nulldrv_FlattenPath,                /* pFlattenPath */
757     nulldrv_FontIsLinked,               /* pFontIsLinked */
758     nulldrv_FrameRgn,                   /* pFrameRgn */
759     nulldrv_GdiComment,                 /* pGdiComment */
760     nulldrv_GdiRealizationInfo,         /* pGdiRealizationInfo */
761     nulldrv_GetBoundsRect,              /* pGetBoundsRect */
762     nulldrv_GetCharABCWidths,           /* pGetCharABCWidths */
763     nulldrv_GetCharABCWidthsI,          /* pGetCharABCWidthsI */
764     nulldrv_GetCharWidth,               /* pGetCharWidth */
765     nulldrv_GetDeviceCaps,              /* pGetDeviceCaps */
766     nulldrv_GetDeviceGammaRamp,         /* pGetDeviceGammaRamp */
767     nulldrv_GetFontData,                /* pGetFontData */
768     nulldrv_GetFontUnicodeRanges,       /* pGetFontUnicodeRanges */
769     nulldrv_GetGlyphIndices,            /* pGetGlyphIndices */
770     nulldrv_GetGlyphOutline,            /* pGetGlyphOutline */
771     nulldrv_GetICMProfile,              /* pGetICMProfile */
772     nulldrv_GetImage,                   /* pGetImage */
773     nulldrv_GetKerningPairs,            /* pGetKerningPairs */
774     nulldrv_GetNearestColor,            /* pGetNearestColor */
775     nulldrv_GetOutlineTextMetrics,      /* pGetOutlineTextMetrics */
776     nulldrv_GetPixel,                   /* pGetPixel */
777     nulldrv_GetSystemPaletteEntries,    /* pGetSystemPaletteEntries */
778     nulldrv_GetTextCharsetInfo,         /* pGetTextCharsetInfo */
779     nulldrv_GetTextExtentExPoint,       /* pGetTextExtentExPoint */
780     nulldrv_GetTextExtentExPointI,      /* pGetTextExtentExPointI */
781     nulldrv_GetTextFace,                /* pGetTextFace */
782     nulldrv_GetTextMetrics,             /* pGetTextMetrics */
783     nulldrv_GradientFill,               /* pGradientFill */
784     nulldrv_IntersectClipRect,          /* pIntersectClipRect */
785     nulldrv_InvertRgn,                  /* pInvertRgn */
786     nulldrv_LineTo,                     /* pLineTo */
787     nulldrv_ModifyWorldTransform,       /* pModifyWorldTransform */
788     nulldrv_MoveTo,                     /* pMoveTo */
789     nulldrv_OffsetClipRgn,              /* pOffsetClipRgn */
790     nulldrv_OffsetViewportOrgEx,        /* pOffsetViewportOrg */
791     nulldrv_OffsetWindowOrgEx,          /* pOffsetWindowOrg */
792     nulldrv_PaintRgn,                   /* pPaintRgn */
793     nulldrv_PatBlt,                     /* pPatBlt */
794     nulldrv_Pie,                        /* pPie */
795     nulldrv_PolyBezier,                 /* pPolyBezier */
796     nulldrv_PolyBezierTo,               /* pPolyBezierTo */
797     nulldrv_PolyDraw,                   /* pPolyDraw */
798     nulldrv_PolyPolygon,                /* pPolyPolygon */
799     nulldrv_PolyPolyline,               /* pPolyPolyline */
800     nulldrv_Polygon,                    /* pPolygon */
801     nulldrv_Polyline,                   /* pPolyline */
802     nulldrv_PolylineTo,                 /* pPolylineTo */
803     nulldrv_PutImage,                   /* pPutImage */
804     nulldrv_RealizeDefaultPalette,      /* pRealizeDefaultPalette */
805     nulldrv_RealizePalette,             /* pRealizePalette */
806     nulldrv_Rectangle,                  /* pRectangle */
807     nulldrv_ResetDC,                    /* pResetDC */
808     nulldrv_RestoreDC,                  /* pRestoreDC */
809     nulldrv_RoundRect,                  /* pRoundRect */
810     nulldrv_SaveDC,                     /* pSaveDC */
811     nulldrv_ScaleViewportExtEx,         /* pScaleViewportExt */
812     nulldrv_ScaleWindowExtEx,           /* pScaleWindowExt */
813     nulldrv_SelectBitmap,               /* pSelectBitmap */
814     nulldrv_SelectBrush,                /* pSelectBrush */
815     nulldrv_SelectClipPath,             /* pSelectClipPath */
816     nulldrv_SelectFont,                 /* pSelectFont */
817     nulldrv_SelectPalette,              /* pSelectPalette */
818     nulldrv_SelectPen,                  /* pSelectPen */
819     nulldrv_SetArcDirection,            /* pSetArcDirection */
820     nulldrv_SetBkColor,                 /* pSetBkColor */
821     nulldrv_SetBkMode,                  /* pSetBkMode */
822     nulldrv_SetBoundsRect,              /* pSetBoundsRect */
823     nulldrv_SetDCBrushColor,            /* pSetDCBrushColor */
824     nulldrv_SetDCPenColor,              /* pSetDCPenColor */
825     nulldrv_SetDIBitsToDevice,          /* pSetDIBitsToDevice */
826     nulldrv_SetDeviceClipping,          /* pSetDeviceClipping */
827     nulldrv_SetDeviceGammaRamp,         /* pSetDeviceGammaRamp */
828     nulldrv_SetLayout,                  /* pSetLayout */
829     nulldrv_SetMapMode,                 /* pSetMapMode */
830     nulldrv_SetMapperFlags,             /* pSetMapperFlags */
831     nulldrv_SetPixel,                   /* pSetPixel */
832     nulldrv_SetPixelFormat,             /* pSetPixelFormat */
833     nulldrv_SetPolyFillMode,            /* pSetPolyFillMode */
834     nulldrv_SetROP2,                    /* pSetROP2 */
835     nulldrv_SetRelAbs,                  /* pSetRelAbs */
836     nulldrv_SetStretchBltMode,          /* pSetStretchBltMode */
837     nulldrv_SetTextAlign,               /* pSetTextAlign */
838     nulldrv_SetTextCharacterExtra,      /* pSetTextCharacterExtra */
839     nulldrv_SetTextColor,               /* pSetTextColor */
840     nulldrv_SetTextJustification,       /* pSetTextJustification */
841     nulldrv_SetViewportExtEx,           /* pSetViewportExt */
842     nulldrv_SetViewportOrgEx,           /* pSetViewportOrg */
843     nulldrv_SetWindowExtEx,             /* pSetWindowExt */
844     nulldrv_SetWindowOrgEx,             /* pSetWindowOrg */
845     nulldrv_SetWorldTransform,          /* pSetWorldTransform */
846     nulldrv_StartDoc,                   /* pStartDoc */
847     nulldrv_StartPage,                  /* pStartPage */
848     nulldrv_StretchBlt,                 /* pStretchBlt */
849     nulldrv_StretchDIBits,              /* pStretchDIBits */
850     nulldrv_StrokeAndFillPath,          /* pStrokeAndFillPath */
851     nulldrv_StrokePath,                 /* pStrokePath */
852     nulldrv_SwapBuffers,                /* pSwapBuffers */
853     nulldrv_UnrealizePalette,           /* pUnrealizePalette */
854     nulldrv_WidenPath,                  /* pWidenPath */
855     nulldrv_wine_get_wgl_driver,        /* wine_get_wgl_driver */
856
857     GDI_PRIORITY_NULL_DRV               /* priority */
858 };
859
860 static const struct wgl_funcs null_wgl_driver =
861 {
862     nulldrv_GetPixelFormat,             /* p_GetPixelFormat */
863     nulldrv_wglCopyContext,             /* p_wglCopyContext */
864     nulldrv_wglCreateContext,           /* p_wglCreateContext */
865     nulldrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */
866     nulldrv_wglDeleteContext,           /* p_wglDeleteContext */
867     nulldrv_wglGetCurrentDC,            /* p_wglGetCurrentDC */
868     nulldrv_wglGetProcAddress,          /* p_wglGetProcAddress */
869     nulldrv_wglMakeContextCurrentARB,   /* p_wglMakeContextCurrentARB */
870     nulldrv_wglMakeCurrent,             /* p_wglMakeCurrent */
871     nulldrv_wglShareLists,              /* p_wglShareLists */
872 };
873
874 /*****************************************************************************
875  *      DRIVER_GetDriverName
876  *
877  */
878 BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
879 {
880     static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
881     static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
882     static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
883     static const WCHAR empty_strW[] = { 0 };
884     WCHAR *p;
885
886     /* display is a special case */
887     if (!strcmpiW( device, displayW ) ||
888         !strcmpiW( device, display1W ))
889     {
890         lstrcpynW( driver, displayW, size );
891         return TRUE;
892     }
893
894     size = GetProfileStringW(devicesW, device, empty_strW, driver, size);
895     if(!size) {
896         WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
897         return FALSE;
898     }
899     p = strchrW(driver, ',');
900     if(!p)
901     {
902         WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device));
903         return FALSE;
904     }
905     *p = 0;
906     TRACE("Found %s for %s\n", debugstr_w(driver), debugstr_w(device));
907     return TRUE;
908 }
909
910
911 /***********************************************************************
912  *           GdiConvertToDevmodeW    (GDI32.@)
913  */
914 DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
915 {
916     DEVMODEW *dmW;
917     WORD dmW_size, dmA_size;
918
919     dmA_size = dmA->dmSize;
920
921     /* this is the minimal dmSize that XP accepts */
922     if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
923         return NULL;
924
925     if (dmA_size > sizeof(DEVMODEA))
926         dmA_size = sizeof(DEVMODEA);
927
928     dmW_size = dmA_size + CCHDEVICENAME;
929     if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
930         dmW_size += CCHFORMNAME;
931
932     dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
933     if (!dmW) return NULL;
934
935     MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, -1,
936                                    dmW->dmDeviceName, CCHDEVICENAME);
937     /* copy slightly more, to avoid long computations */
938     memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
939
940     if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
941     {
942         if (dmA->dmFields & DM_FORMNAME)
943             MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, -1,
944                                        dmW->dmFormName, CCHFORMNAME);
945         else
946             dmW->dmFormName[0] = 0;
947
948         if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
949             memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
950     }
951
952     if (dmA->dmDriverExtra)
953         memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
954
955     dmW->dmSize = dmW_size;
956
957     return dmW;
958 }
959
960
961 /*****************************************************************************
962  *      @ [GDI32.100]
963  *
964  * This should thunk to 16-bit and simply call the proc with the given args.
965  */
966 INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
967                                  LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
968 {
969     FIXME("(%p, %p, %s, %s, %s)\n", lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
970     return -1;
971 }
972
973 /*****************************************************************************
974  *      @ [GDI32.101]
975  *
976  * This should load the correct driver for lpszDevice and calls this driver's
977  * ExtDeviceModePropSheet proc.
978  *
979  * Note: The driver calls a callback routine for each property sheet page; these
980  * pages are supposed to be filled into the structure pointed to by lpPropSheet.
981  * The layout of this structure is:
982  *
983  * struct
984  * {
985  *   DWORD  nPages;
986  *   DWORD  unknown;
987  *   HPROPSHEETPAGE  pages[10];
988  * };
989  */
990 INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
991                                              LPCSTR lpszPort, LPVOID lpPropSheet )
992 {
993     FIXME("(%p, %s, %s, %p)\n", hWnd, lpszDevice, lpszPort, lpPropSheet );
994     return -1;
995 }
996
997 /*****************************************************************************
998  *      @ [GDI32.102]
999  *
1000  * This should load the correct driver for lpszDevice and call this driver's
1001  * ExtDeviceMode proc.
1002  *
1003  * FIXME: convert ExtDeviceMode to unicode in the driver interface
1004  */
1005 INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
1006                                     LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
1007                                     LPSTR lpszPort, LPDEVMODEA lpdmInput,
1008                                     LPSTR lpszProfile, DWORD fwMode )
1009 {
1010     WCHAR deviceW[300];
1011     WCHAR bufW[300];
1012     char buf[300];
1013     HDC hdc;
1014     DC *dc;
1015     INT ret = -1;
1016
1017     TRACE("(%p, %p, %s, %s, %p, %s, %d)\n",
1018           hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode );
1019
1020     if (!lpszDevice) return -1;
1021     if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
1022
1023     if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
1024
1025     if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
1026
1027     if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
1028
1029     if ((dc = get_dc_ptr( hdc )))
1030     {
1031         PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtDeviceMode );
1032         ret = physdev->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
1033                                               lpdmInput, lpszProfile, fwMode );
1034         release_dc_ptr( dc );
1035     }
1036     DeleteDC( hdc );
1037     return ret;
1038 }
1039
1040 /****************************************************************************
1041  *      @ [GDI32.103]
1042  *
1043  * This should load the correct driver for lpszDevice and calls this driver's
1044  * AdvancedSetupDialog proc.
1045  */
1046 INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
1047                                           LPDEVMODEA devin, LPDEVMODEA devout )
1048 {
1049     TRACE("(%p, %s, %p, %p)\n", hwnd, lpszDevice, devin, devout );
1050     return -1;
1051 }
1052
1053 /*****************************************************************************
1054  *      @ [GDI32.104]
1055  *
1056  * This should load the correct driver for lpszDevice and calls this driver's
1057  * DeviceCapabilities proc.
1058  *
1059  * FIXME: convert DeviceCapabilities to unicode in the driver interface
1060  */
1061 DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
1062                                            WORD fwCapability, LPSTR lpszOutput,
1063                                            LPDEVMODEA lpdm )
1064 {
1065     WCHAR deviceW[300];
1066     WCHAR bufW[300];
1067     char buf[300];
1068     HDC hdc;
1069     DC *dc;
1070     INT ret = -1;
1071
1072     TRACE("(%s, %s, %d, %p, %p)\n", lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
1073
1074     if (!lpszDevice) return -1;
1075     if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
1076
1077     if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
1078
1079     if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
1080
1081     if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
1082
1083     if ((dc = get_dc_ptr( hdc )))
1084     {
1085         PHYSDEV physdev = GET_DC_PHYSDEV( dc, pDeviceCapabilities );
1086         ret = physdev->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
1087                                                    fwCapability, lpszOutput, lpdm );
1088         release_dc_ptr( dc );
1089     }
1090     DeleteDC( hdc );
1091     return ret;
1092 }
1093
1094
1095 /************************************************************************
1096  *             Escape  [GDI32.@]
1097  */
1098 INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
1099 {
1100     INT ret;
1101     POINT *pt;
1102
1103     switch (escape)
1104     {
1105     case ABORTDOC:
1106         return AbortDoc( hdc );
1107
1108     case ENDDOC:
1109         return EndDoc( hdc );
1110
1111     case GETPHYSPAGESIZE:
1112         pt = out_data;
1113         pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
1114         pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
1115         return 1;
1116
1117     case GETPRINTINGOFFSET:
1118         pt = out_data;
1119         pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
1120         pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
1121         return 1;
1122
1123     case GETSCALINGFACTOR:
1124         pt = out_data;
1125         pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
1126         pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
1127         return 1;
1128
1129     case NEWFRAME:
1130         return EndPage( hdc );
1131
1132     case SETABORTPROC:
1133         return SetAbortProc( hdc, (ABORTPROC)in_data );
1134
1135     case STARTDOC:
1136         {
1137             DOCINFOA doc;
1138             char *name = NULL;
1139
1140             /* in_data may not be 0 terminated so we must copy it */
1141             if (in_data)
1142             {
1143                 name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
1144                 memcpy( name, in_data, in_count );
1145                 name[in_count] = 0;
1146             }
1147             /* out_data is actually a pointer to the DocInfo structure and used as
1148              * a second input parameter */
1149             if (out_data) doc = *(DOCINFOA *)out_data;
1150             else
1151             {
1152                 doc.cbSize = sizeof(doc);
1153                 doc.lpszOutput = NULL;
1154                 doc.lpszDatatype = NULL;
1155                 doc.fwType = 0;
1156             }
1157             doc.lpszDocName = name;
1158             ret = StartDocA( hdc, &doc );
1159             HeapFree( GetProcessHeap(), 0, name );
1160             if (ret > 0) ret = StartPage( hdc );
1161             return ret;
1162         }
1163
1164     case QUERYESCSUPPORT:
1165         {
1166             const INT *ptr = (const INT *)in_data;
1167             if (in_count < sizeof(INT)) return 0;
1168             switch(*ptr)
1169             {
1170             case ABORTDOC:
1171             case ENDDOC:
1172             case GETPHYSPAGESIZE:
1173             case GETPRINTINGOFFSET:
1174             case GETSCALINGFACTOR:
1175             case NEWFRAME:
1176             case QUERYESCSUPPORT:
1177             case SETABORTPROC:
1178             case STARTDOC:
1179                 return TRUE;
1180             }
1181             break;
1182         }
1183     }
1184
1185     /* if not handled internally, pass it to the driver */
1186     return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
1187 }
1188
1189
1190 /******************************************************************************
1191  *              ExtEscape       [GDI32.@]
1192  *
1193  * Access capabilities of a particular device that are not available through GDI.
1194  *
1195  * PARAMS
1196  *    hdc         [I] Handle to device context
1197  *    nEscape     [I] Escape function
1198  *    cbInput     [I] Number of bytes in input structure
1199  *    lpszInData  [I] Pointer to input structure
1200  *    cbOutput    [I] Number of bytes in output structure
1201  *    lpszOutData [O] Pointer to output structure
1202  *
1203  * RETURNS
1204  *    Success: >0
1205  *    Not implemented: 0
1206  *    Failure: <0
1207  */
1208 INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
1209                       INT cbOutput, LPSTR lpszOutData )
1210 {
1211     INT ret = 0;
1212     DC * dc = get_dc_ptr( hdc );
1213
1214     if (dc)
1215     {
1216         PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtEscape );
1217         update_dc( dc );
1218         ret = physdev->funcs->pExtEscape( physdev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
1219         release_dc_ptr( dc );
1220     }
1221     return ret;
1222 }
1223
1224
1225 /*******************************************************************
1226  *      DrawEscape [GDI32.@]
1227  *
1228  *
1229  */
1230 INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
1231 {
1232     FIXME("DrawEscape, stub\n");
1233     return 0;
1234 }
1235
1236 /*******************************************************************
1237  *      NamedEscape [GDI32.@]
1238  */
1239 INT WINAPI NamedEscape( HDC hdc, LPCWSTR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData,
1240                         INT cbOutput, LPSTR lpszOutData )
1241 {
1242     FIXME("(%p, %s, %d, %d, %p, %d, %p)\n",
1243           hdc, wine_dbgstr_w(pDriver), nEscape, cbInput, lpszInData, cbOutput,
1244           lpszOutData);
1245     return 0;
1246 }
1247
1248 /*******************************************************************
1249  *      DdQueryDisplaySettingsUniqueness [GDI32.@]
1250  *      GdiEntry13                       [GDI32.@]
1251  */
1252 ULONG WINAPI DdQueryDisplaySettingsUniqueness(VOID)
1253 {
1254     static int warn_once;
1255
1256     if (!warn_once++)
1257         FIXME("stub\n");
1258     return 0;
1259 }