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