shlwapi: Implement SHCreateThreadRef.
[wine.git] / dlls / gdi32 / driver.c
blob05c2513261e17f92fc38ca80ea93c08ea864896b
1 /*
2 * Graphics driver management functions
4 * Copyright 1994 Bob Amstadt
5 * Copyright 1996, 2001 Alexandre Julliard
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.
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.
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
22 #include "config.h"
23 #include "wine/port.h"
25 #include <stdarg.h>
26 #include <string.h>
27 #include <stdio.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winreg.h"
31 #include "ddrawgdi.h"
32 #include "wine/winbase16.h"
34 #include "gdi_private.h"
35 #include "wine/unicode.h"
36 #include "wine/list.h"
37 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(driver);
41 struct graphics_driver
43 struct list entry;
44 HMODULE module; /* module handle */
45 unsigned int count; /* reference count */
46 DC_FUNCTIONS funcs;
49 static struct list drivers = LIST_INIT( drivers );
50 static struct graphics_driver *display_driver;
52 static CRITICAL_SECTION driver_section;
53 static CRITICAL_SECTION_DEBUG critsect_debug =
55 0, 0, &driver_section,
56 { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
57 0, 0, { (DWORD_PTR)(__FILE__ ": driver_section") }
59 static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
61 /**********************************************************************
62 * create_driver
64 * Allocate and fill the driver structure for a given module.
66 static struct graphics_driver *create_driver( HMODULE module )
68 struct graphics_driver *driver;
70 if (!(driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver)))) return NULL;
71 driver->module = module;
72 driver->count = 1;
74 /* fill the function table */
75 if (module)
77 #define GET_FUNC(name) driver->funcs.p##name = (void*)GetProcAddress( module, #name )
78 GET_FUNC(AbortDoc);
79 GET_FUNC(AbortPath);
80 GET_FUNC(AlphaBlend);
81 GET_FUNC(AngleArc);
82 GET_FUNC(Arc);
83 GET_FUNC(ArcTo);
84 GET_FUNC(BeginPath);
85 GET_FUNC(BitBlt);
86 GET_FUNC(ChoosePixelFormat);
87 GET_FUNC(Chord);
88 GET_FUNC(CloseFigure);
89 GET_FUNC(CreateBitmap);
90 GET_FUNC(CreateDC);
91 GET_FUNC(CreateDIBSection);
92 GET_FUNC(DeleteBitmap);
93 GET_FUNC(DeleteDC);
94 GET_FUNC(DescribePixelFormat);
95 GET_FUNC(DeviceCapabilities);
96 GET_FUNC(Ellipse);
97 GET_FUNC(EndDoc);
98 GET_FUNC(EndPage);
99 GET_FUNC(EndPath);
100 GET_FUNC(EnumDeviceFonts);
101 GET_FUNC(ExcludeClipRect);
102 GET_FUNC(ExtDeviceMode);
103 GET_FUNC(ExtEscape);
104 GET_FUNC(ExtFloodFill);
105 GET_FUNC(ExtSelectClipRgn);
106 GET_FUNC(ExtTextOut);
107 GET_FUNC(FillPath);
108 GET_FUNC(FillRgn);
109 GET_FUNC(FlattenPath);
110 GET_FUNC(FrameRgn);
111 GET_FUNC(GdiComment);
112 GET_FUNC(GetBitmapBits);
113 GET_FUNC(GetCharWidth);
114 GET_FUNC(GetDCOrgEx);
115 GET_FUNC(GetDIBColorTable);
116 GET_FUNC(GetDIBits);
117 GET_FUNC(GetDeviceCaps);
118 GET_FUNC(GetDeviceGammaRamp);
119 GET_FUNC(GetICMProfile);
120 GET_FUNC(GetNearestColor);
121 GET_FUNC(GetPixel);
122 GET_FUNC(GetPixelFormat);
123 GET_FUNC(GetSystemPaletteEntries);
124 GET_FUNC(GetTextExtentExPoint);
125 GET_FUNC(GetTextMetrics);
126 GET_FUNC(IntersectClipRect);
127 GET_FUNC(InvertRgn);
128 GET_FUNC(LineTo);
129 GET_FUNC(MoveTo);
130 GET_FUNC(ModifyWorldTransform);
131 GET_FUNC(OffsetClipRgn);
132 GET_FUNC(OffsetViewportOrg);
133 GET_FUNC(OffsetWindowOrg);
134 GET_FUNC(PaintRgn);
135 GET_FUNC(PatBlt);
136 GET_FUNC(Pie);
137 GET_FUNC(PolyBezier);
138 GET_FUNC(PolyBezierTo);
139 GET_FUNC(PolyDraw);
140 GET_FUNC(PolyPolygon);
141 GET_FUNC(PolyPolyline);
142 GET_FUNC(Polygon);
143 GET_FUNC(Polyline);
144 GET_FUNC(PolylineTo);
145 GET_FUNC(RealizeDefaultPalette);
146 GET_FUNC(RealizePalette);
147 GET_FUNC(Rectangle);
148 GET_FUNC(ResetDC);
149 GET_FUNC(RestoreDC);
150 GET_FUNC(RoundRect);
151 GET_FUNC(SaveDC);
152 GET_FUNC(ScaleViewportExt);
153 GET_FUNC(ScaleWindowExt);
154 GET_FUNC(SelectBitmap);
155 GET_FUNC(SelectBrush);
156 GET_FUNC(SelectClipPath);
157 GET_FUNC(SelectFont);
158 GET_FUNC(SelectPalette);
159 GET_FUNC(SelectPen);
160 GET_FUNC(SetArcDirection);
161 GET_FUNC(SetBitmapBits);
162 GET_FUNC(SetBkColor);
163 GET_FUNC(SetBkMode);
164 GET_FUNC(SetDCBrushColor);
165 GET_FUNC(SetDCPenColor);
166 GET_FUNC(SetDIBColorTable);
167 GET_FUNC(SetDIBits);
168 GET_FUNC(SetDIBitsToDevice);
169 GET_FUNC(SetDeviceClipping);
170 GET_FUNC(SetDeviceGammaRamp);
171 GET_FUNC(SetMapMode);
172 GET_FUNC(SetMapperFlags);
173 GET_FUNC(SetPixel);
174 GET_FUNC(SetPixelFormat);
175 GET_FUNC(SetPolyFillMode);
176 GET_FUNC(SetROP2);
177 GET_FUNC(SetRelAbs);
178 GET_FUNC(SetStretchBltMode);
179 GET_FUNC(SetTextAlign);
180 GET_FUNC(SetTextCharacterExtra);
181 GET_FUNC(SetTextColor);
182 GET_FUNC(SetTextJustification);
183 GET_FUNC(SetViewportExt);
184 GET_FUNC(SetViewportOrg);
185 GET_FUNC(SetWindowExt);
186 GET_FUNC(SetWindowOrg);
187 GET_FUNC(SetWorldTransform);
188 GET_FUNC(StartDoc);
189 GET_FUNC(StartPage);
190 GET_FUNC(StretchBlt);
191 GET_FUNC(StretchDIBits);
192 GET_FUNC(StrokeAndFillPath);
193 GET_FUNC(StrokePath);
194 GET_FUNC(SwapBuffers);
195 GET_FUNC(UnrealizePalette);
196 GET_FUNC(WidenPath);
198 /* OpenGL32 */
199 GET_FUNC(wglCreateContext);
200 GET_FUNC(wglCreateContextAttribsARB);
201 GET_FUNC(wglDeleteContext);
202 GET_FUNC(wglGetProcAddress);
203 GET_FUNC(wglGetPbufferDCARB);
204 GET_FUNC(wglMakeContextCurrentARB);
205 GET_FUNC(wglMakeCurrent);
206 GET_FUNC(wglSetPixelFormatWINE);
207 GET_FUNC(wglShareLists);
208 GET_FUNC(wglUseFontBitmapsA);
209 GET_FUNC(wglUseFontBitmapsW);
210 #undef GET_FUNC
212 else memset( &driver->funcs, 0, sizeof(driver->funcs) );
214 list_add_head( &drivers, &driver->entry );
215 return driver;
219 /**********************************************************************
220 * load_display_driver
222 * Special case for loading the display driver: get the name from the config file
224 static struct graphics_driver *load_display_driver(void)
226 char buffer[MAX_PATH], libname[32], *name, *next;
227 HMODULE module = 0;
228 HKEY hkey;
230 if (display_driver) /* already loaded */
232 display_driver->count++;
233 return display_driver;
236 strcpy( buffer, "x11" ); /* default value */
237 /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
238 if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey ))
240 DWORD type, count = sizeof(buffer);
241 RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count );
242 RegCloseKey( hkey );
245 name = buffer;
246 while (name)
248 next = strchr( name, ',' );
249 if (next) *next++ = 0;
251 snprintf( libname, sizeof(libname), "wine%s.drv", name );
252 if ((module = LoadLibraryA( libname )) != 0) break;
253 name = next;
256 if (!(display_driver = create_driver( module )))
258 MESSAGE( "Could not create graphics driver '%s'\n", buffer );
259 FreeLibrary( module );
260 ExitProcess(1);
263 display_driver->count++; /* we don't want to free it */
264 return display_driver;
268 /**********************************************************************
269 * DRIVER_load_driver
271 const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
273 HMODULE module;
274 struct graphics_driver *driver;
275 static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
276 static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
278 EnterCriticalSection( &driver_section );
280 /* display driver is a special case */
281 if (!strcmpiW( name, displayW ) ||
282 !strcmpiW( name, display1W ))
284 driver = load_display_driver();
285 LeaveCriticalSection( &driver_section );
286 return &driver->funcs;
289 if ((module = GetModuleHandleW( name )))
291 LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
293 if (driver->module == module)
295 driver->count++;
296 LeaveCriticalSection( &driver_section );
297 return &driver->funcs;
302 if (!(module = LoadLibraryW( name )))
304 LeaveCriticalSection( &driver_section );
305 return NULL;
308 if (!(driver = create_driver( module )))
310 FreeLibrary( module );
311 LeaveCriticalSection( &driver_section );
312 return NULL;
315 TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
316 LeaveCriticalSection( &driver_section );
317 return &driver->funcs;
321 /**********************************************************************
322 * DRIVER_get_driver
324 * Get a new copy of an existing driver.
326 const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs )
328 struct graphics_driver *driver;
330 EnterCriticalSection( &driver_section );
331 LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
332 if (&driver->funcs == funcs) break;
333 if (&driver->entry == &drivers) ERR( "driver not found, trouble ahead\n" );
334 driver->count++;
335 LeaveCriticalSection( &driver_section );
336 return funcs;
340 /**********************************************************************
341 * DRIVER_release_driver
343 * Release a driver by decrementing ref count and freeing it if needed.
345 void DRIVER_release_driver( const DC_FUNCTIONS *funcs )
347 struct graphics_driver *driver;
349 EnterCriticalSection( &driver_section );
351 LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
353 if (&driver->funcs != funcs) continue;
354 if (--driver->count) break;
355 list_remove( &driver->entry );
356 if (driver == display_driver) display_driver = NULL;
357 FreeLibrary( driver->module );
358 HeapFree( GetProcessHeap(), 0, driver );
359 break;
361 LeaveCriticalSection( &driver_section );
365 /*****************************************************************************
366 * DRIVER_GetDriverName
369 BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
371 static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
372 static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
373 static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
374 static const WCHAR empty_strW[] = { 0 };
375 WCHAR *p;
377 /* display is a special case */
378 if (!strcmpiW( device, displayW ) ||
379 !strcmpiW( device, display1W ))
381 lstrcpynW( driver, displayW, size );
382 return TRUE;
385 size = GetProfileStringW(devicesW, device, empty_strW, driver, size);
386 if(!size) {
387 WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
388 return FALSE;
390 p = strchrW(driver, ',');
391 if(!p)
393 WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device));
394 return FALSE;
396 *p = 0;
397 TRACE("Found %s for %s\n", debugstr_w(driver), debugstr_w(device));
398 return TRUE;
402 /***********************************************************************
403 * GdiConvertToDevmodeW (GDI32.@)
405 DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
407 DEVMODEW *dmW;
408 WORD dmW_size, dmA_size;
410 dmA_size = dmA->dmSize;
412 /* this is the minimal dmSize that XP accepts */
413 if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
414 return NULL;
416 if (dmA_size > sizeof(DEVMODEA))
417 dmA_size = sizeof(DEVMODEA);
419 dmW_size = dmA_size + CCHDEVICENAME;
420 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
421 dmW_size += CCHFORMNAME;
423 dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
424 if (!dmW) return NULL;
426 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, -1,
427 dmW->dmDeviceName, CCHDEVICENAME);
428 /* copy slightly more, to avoid long computations */
429 memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
431 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
433 if (dmA->dmFields & DM_FORMNAME)
434 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, -1,
435 dmW->dmFormName, CCHFORMNAME);
436 else
437 dmW->dmFormName[0] = 0;
439 if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
440 memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
443 if (dmA->dmDriverExtra)
444 memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
446 dmW->dmSize = dmW_size;
448 return dmW;
452 /*****************************************************************************
453 * @ [GDI32.100]
455 * This should thunk to 16-bit and simply call the proc with the given args.
457 INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
458 LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
460 FIXME("(%p, %p, %s, %s, %s)\n", lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
461 return -1;
464 /*****************************************************************************
465 * @ [GDI32.101]
467 * This should load the correct driver for lpszDevice and calls this driver's
468 * ExtDeviceModePropSheet proc.
470 * Note: The driver calls a callback routine for each property sheet page; these
471 * pages are supposed to be filled into the structure pointed to by lpPropSheet.
472 * The layout of this structure is:
474 * struct
476 * DWORD nPages;
477 * DWORD unknown;
478 * HPROPSHEETPAGE pages[10];
479 * };
481 INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
482 LPCSTR lpszPort, LPVOID lpPropSheet )
484 FIXME("(%p, %s, %s, %p)\n", hWnd, lpszDevice, lpszPort, lpPropSheet );
485 return -1;
488 /*****************************************************************************
489 * @ [GDI32.102]
491 * This should load the correct driver for lpszDevice and call this driver's
492 * ExtDeviceMode proc.
494 * FIXME: convert ExtDeviceMode to unicode in the driver interface
496 INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
497 LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
498 LPSTR lpszPort, LPDEVMODEA lpdmInput,
499 LPSTR lpszProfile, DWORD fwMode )
501 WCHAR deviceW[300];
502 WCHAR bufW[300];
503 char buf[300];
504 HDC hdc;
505 DC *dc;
506 INT ret = -1;
508 TRACE("(%p, %p, %s, %s, %p, %s, %d)\n",
509 hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode );
511 if (!lpszDevice) return -1;
512 if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
514 if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
516 if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
518 if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
520 if ((dc = get_dc_ptr( hdc )))
522 if (dc->funcs->pExtDeviceMode)
523 ret = dc->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
524 lpdmInput, lpszProfile, fwMode );
525 release_dc_ptr( dc );
527 DeleteDC( hdc );
528 return ret;
531 /****************************************************************************
532 * @ [GDI32.103]
534 * This should load the correct driver for lpszDevice and calls this driver's
535 * AdvancedSetupDialog proc.
537 INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
538 LPDEVMODEA devin, LPDEVMODEA devout )
540 TRACE("(%p, %s, %p, %p)\n", hwnd, lpszDevice, devin, devout );
541 return -1;
544 /*****************************************************************************
545 * @ [GDI32.104]
547 * This should load the correct driver for lpszDevice and calls this driver's
548 * DeviceCapabilities proc.
550 * FIXME: convert DeviceCapabilities to unicode in the driver interface
552 DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
553 WORD fwCapability, LPSTR lpszOutput,
554 LPDEVMODEA lpdm )
556 WCHAR deviceW[300];
557 WCHAR bufW[300];
558 char buf[300];
559 HDC hdc;
560 DC *dc;
561 INT ret = -1;
563 TRACE("(%s, %s, %d, %p, %p)\n", lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
565 if (!lpszDevice) return -1;
566 if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
568 if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
570 if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
572 if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
574 if ((dc = get_dc_ptr( hdc )))
576 if (dc->funcs->pDeviceCapabilities)
577 ret = dc->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
578 fwCapability, lpszOutput, lpdm );
579 release_dc_ptr( dc );
581 DeleteDC( hdc );
582 return ret;
586 /************************************************************************
587 * Escape [GDI32.@]
589 INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
591 INT ret;
592 POINT *pt;
594 switch (escape)
596 case ABORTDOC:
597 return AbortDoc( hdc );
599 case ENDDOC:
600 return EndDoc( hdc );
602 case GETPHYSPAGESIZE:
603 pt = out_data;
604 pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
605 pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
606 return 1;
608 case GETPRINTINGOFFSET:
609 pt = out_data;
610 pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
611 pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
612 return 1;
614 case GETSCALINGFACTOR:
615 pt = out_data;
616 pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
617 pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
618 return 1;
620 case NEWFRAME:
621 return EndPage( hdc );
623 case SETABORTPROC:
624 return SetAbortProc( hdc, (ABORTPROC)in_data );
626 case STARTDOC:
628 DOCINFOA doc;
629 char *name = NULL;
631 /* in_data may not be 0 terminated so we must copy it */
632 if (in_data)
634 name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
635 memcpy( name, in_data, in_count );
636 name[in_count] = 0;
638 /* out_data is actually a pointer to the DocInfo structure and used as
639 * a second input parameter */
640 if (out_data) doc = *(DOCINFOA *)out_data;
641 else
643 doc.cbSize = sizeof(doc);
644 doc.lpszOutput = NULL;
645 doc.lpszDatatype = NULL;
646 doc.fwType = 0;
648 doc.lpszDocName = name;
649 ret = StartDocA( hdc, &doc );
650 HeapFree( GetProcessHeap(), 0, name );
651 if (ret > 0) ret = StartPage( hdc );
652 return ret;
655 case QUERYESCSUPPORT:
657 const INT *ptr = (const INT *)in_data;
658 if (in_count < sizeof(INT)) return 0;
659 switch(*ptr)
661 case ABORTDOC:
662 case ENDDOC:
663 case GETPHYSPAGESIZE:
664 case GETPRINTINGOFFSET:
665 case GETSCALINGFACTOR:
666 case NEWFRAME:
667 case QUERYESCSUPPORT:
668 case SETABORTPROC:
669 case STARTDOC:
670 return TRUE;
672 break;
676 /* if not handled internally, pass it to the driver */
677 return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
681 /******************************************************************************
682 * ExtEscape [GDI32.@]
684 * Access capabilities of a particular device that are not available through GDI.
686 * PARAMS
687 * hdc [I] Handle to device context
688 * nEscape [I] Escape function
689 * cbInput [I] Number of bytes in input structure
690 * lpszInData [I] Pointer to input structure
691 * cbOutput [I] Number of bytes in output structure
692 * lpszOutData [O] Pointer to output structure
694 * RETURNS
695 * Success: >0
696 * Not implemented: 0
697 * Failure: <0
699 INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
700 INT cbOutput, LPSTR lpszOutData )
702 INT ret = 0;
703 DC * dc = get_dc_ptr( hdc );
704 if (dc)
706 if (dc->funcs->pExtEscape)
707 ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
708 release_dc_ptr( dc );
710 return ret;
714 /*******************************************************************
715 * DrawEscape [GDI32.@]
719 INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
721 FIXME("DrawEscape, stub\n");
722 return 0;
725 /*******************************************************************
726 * NamedEscape [GDI32.@]
728 INT WINAPI NamedEscape( HDC hdc, LPCWSTR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData,
729 INT cbOutput, LPSTR lpszOutData )
731 FIXME("(%p, %s, %d, %d, %p, %d, %p)\n",
732 hdc, wine_dbgstr_w(pDriver), nEscape, cbInput, lpszInData, cbOutput,
733 lpszOutData);
734 return 0;
737 /*******************************************************************
738 * DdQueryDisplaySettingsUniqueness [GDI32.@]
739 * GdiEntry13 [GDI32.@]
741 ULONG WINAPI DdQueryDisplaySettingsUniqueness(VOID)
743 static int warn_once;
745 if (!warn_once++)
746 FIXME("stub\n");
747 return 0;