msvcrt: Export a few more C++ functions that actually call standard C functions.
[wine/multimedia.git] / dlls / gdi32 / driver.c
blob639e4a8000d1640aff56fc9128bbf7f45b3667fa
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/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(driver);
40 struct graphics_driver
42 struct graphics_driver *next;
43 struct graphics_driver *prev;
44 HMODULE module; /* module handle */
45 unsigned int count; /* reference count */
46 DC_FUNCTIONS funcs;
49 static struct graphics_driver *first_driver;
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->next = NULL;
72 driver->prev = NULL;
73 driver->module = module;
74 driver->count = 1;
76 /* fill the function table */
77 if (module)
79 #define GET_FUNC(name) driver->funcs.p##name = (void*)GetProcAddress( module, #name )
80 GET_FUNC(AbortDoc);
81 GET_FUNC(AbortPath);
82 GET_FUNC(AlphaBlend);
83 GET_FUNC(AngleArc);
84 GET_FUNC(Arc);
85 GET_FUNC(ArcTo);
86 GET_FUNC(BeginPath);
87 GET_FUNC(BitBlt);
88 GET_FUNC(ChoosePixelFormat);
89 GET_FUNC(Chord);
90 GET_FUNC(CloseFigure);
91 GET_FUNC(CreateBitmap);
92 GET_FUNC(CreateDC);
93 GET_FUNC(CreateDIBSection);
94 GET_FUNC(DeleteBitmap);
95 GET_FUNC(DeleteDC);
96 GET_FUNC(DescribePixelFormat);
97 GET_FUNC(DeviceCapabilities);
98 GET_FUNC(Ellipse);
99 GET_FUNC(EndDoc);
100 GET_FUNC(EndPage);
101 GET_FUNC(EndPath);
102 GET_FUNC(EnumDeviceFonts);
103 GET_FUNC(ExcludeClipRect);
104 GET_FUNC(ExtDeviceMode);
105 GET_FUNC(ExtEscape);
106 GET_FUNC(ExtFloodFill);
107 GET_FUNC(ExtSelectClipRgn);
108 GET_FUNC(ExtTextOut);
109 GET_FUNC(FillPath);
110 GET_FUNC(FillRgn);
111 GET_FUNC(FlattenPath);
112 GET_FUNC(FrameRgn);
113 GET_FUNC(GdiComment);
114 GET_FUNC(GetBitmapBits);
115 GET_FUNC(GetCharWidth);
116 GET_FUNC(GetDCOrgEx);
117 GET_FUNC(GetDIBColorTable);
118 GET_FUNC(GetDIBits);
119 GET_FUNC(GetDeviceCaps);
120 GET_FUNC(GetDeviceGammaRamp);
121 GET_FUNC(GetICMProfile);
122 GET_FUNC(GetNearestColor);
123 GET_FUNC(GetPixel);
124 GET_FUNC(GetPixelFormat);
125 GET_FUNC(GetSystemPaletteEntries);
126 GET_FUNC(GetTextExtentExPoint);
127 GET_FUNC(GetTextMetrics);
128 GET_FUNC(IntersectClipRect);
129 GET_FUNC(InvertRgn);
130 GET_FUNC(LineTo);
131 GET_FUNC(MoveTo);
132 GET_FUNC(ModifyWorldTransform);
133 GET_FUNC(OffsetClipRgn);
134 GET_FUNC(OffsetViewportOrg);
135 GET_FUNC(OffsetWindowOrg);
136 GET_FUNC(PaintRgn);
137 GET_FUNC(PatBlt);
138 GET_FUNC(Pie);
139 GET_FUNC(PolyBezier);
140 GET_FUNC(PolyBezierTo);
141 GET_FUNC(PolyDraw);
142 GET_FUNC(PolyPolygon);
143 GET_FUNC(PolyPolyline);
144 GET_FUNC(Polygon);
145 GET_FUNC(Polyline);
146 GET_FUNC(PolylineTo);
147 GET_FUNC(RealizeDefaultPalette);
148 GET_FUNC(RealizePalette);
149 GET_FUNC(Rectangle);
150 GET_FUNC(ResetDC);
151 GET_FUNC(RestoreDC);
152 GET_FUNC(RoundRect);
153 GET_FUNC(SaveDC);
154 GET_FUNC(ScaleViewportExt);
155 GET_FUNC(ScaleWindowExt);
156 GET_FUNC(SelectBitmap);
157 GET_FUNC(SelectBrush);
158 GET_FUNC(SelectClipPath);
159 GET_FUNC(SelectFont);
160 GET_FUNC(SelectPalette);
161 GET_FUNC(SelectPen);
162 GET_FUNC(SetArcDirection);
163 GET_FUNC(SetBitmapBits);
164 GET_FUNC(SetBkColor);
165 GET_FUNC(SetBkMode);
166 GET_FUNC(SetDCBrushColor);
167 GET_FUNC(SetDCPenColor);
168 GET_FUNC(SetDIBColorTable);
169 GET_FUNC(SetDIBits);
170 GET_FUNC(SetDIBitsToDevice);
171 GET_FUNC(SetDeviceClipping);
172 GET_FUNC(SetDeviceGammaRamp);
173 GET_FUNC(SetMapMode);
174 GET_FUNC(SetMapperFlags);
175 GET_FUNC(SetPixel);
176 GET_FUNC(SetPixelFormat);
177 GET_FUNC(SetPolyFillMode);
178 GET_FUNC(SetROP2);
179 GET_FUNC(SetRelAbs);
180 GET_FUNC(SetStretchBltMode);
181 GET_FUNC(SetTextAlign);
182 GET_FUNC(SetTextCharacterExtra);
183 GET_FUNC(SetTextColor);
184 GET_FUNC(SetTextJustification);
185 GET_FUNC(SetViewportExt);
186 GET_FUNC(SetViewportOrg);
187 GET_FUNC(SetWindowExt);
188 GET_FUNC(SetWindowOrg);
189 GET_FUNC(SetWorldTransform);
190 GET_FUNC(StartDoc);
191 GET_FUNC(StartPage);
192 GET_FUNC(StretchBlt);
193 GET_FUNC(StretchDIBits);
194 GET_FUNC(StrokeAndFillPath);
195 GET_FUNC(StrokePath);
196 GET_FUNC(SwapBuffers);
197 GET_FUNC(UnrealizePalette);
198 GET_FUNC(WidenPath);
200 /* OpenGL32 */
201 GET_FUNC(wglCreateContext);
202 GET_FUNC(wglCreateContextAttribsARB);
203 GET_FUNC(wglDeleteContext);
204 GET_FUNC(wglGetProcAddress);
205 GET_FUNC(wglGetPbufferDCARB);
206 GET_FUNC(wglMakeContextCurrentARB);
207 GET_FUNC(wglMakeCurrent);
208 GET_FUNC(wglSetPixelFormatWINE);
209 GET_FUNC(wglShareLists);
210 GET_FUNC(wglUseFontBitmapsA);
211 GET_FUNC(wglUseFontBitmapsW);
212 #undef GET_FUNC
214 else memset( &driver->funcs, 0, sizeof(driver->funcs) );
216 /* add it to the list */
217 driver->prev = NULL;
218 if ((driver->next = first_driver)) driver->next->prev = driver;
219 first_driver = driver;
220 return driver;
224 /**********************************************************************
225 * load_display_driver
227 * Special case for loading the display driver: get the name from the config file
229 static struct graphics_driver *load_display_driver(void)
231 char buffer[MAX_PATH], libname[32], *name, *next;
232 HMODULE module = 0;
233 HKEY hkey;
235 if (display_driver) /* already loaded */
237 display_driver->count++;
238 return display_driver;
241 strcpy( buffer, "x11" ); /* default value */
242 /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
243 if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey ))
245 DWORD type, count = sizeof(buffer);
246 RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count );
247 RegCloseKey( hkey );
250 name = buffer;
251 while (name)
253 next = strchr( name, ',' );
254 if (next) *next++ = 0;
256 snprintf( libname, sizeof(libname), "wine%s.drv", name );
257 if ((module = LoadLibraryA( libname )) != 0) break;
258 name = next;
261 if (!(display_driver = create_driver( module )))
263 MESSAGE( "Could not create graphics driver '%s'\n", buffer );
264 FreeLibrary( module );
265 ExitProcess(1);
268 display_driver->count++; /* we don't want to free it */
269 return display_driver;
273 /**********************************************************************
274 * DRIVER_load_driver
276 const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name )
278 HMODULE module;
279 struct graphics_driver *driver;
280 static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
281 static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
283 EnterCriticalSection( &driver_section );
285 /* display driver is a special case */
286 if (!strcmpiW( name, displayW ) ||
287 !strcmpiW( name, display1W ))
289 driver = load_display_driver();
290 LeaveCriticalSection( &driver_section );
291 return &driver->funcs;
294 if ((module = GetModuleHandleW( name )))
296 for (driver = first_driver; driver; driver = driver->next)
298 if (driver->module == module)
300 driver->count++;
301 LeaveCriticalSection( &driver_section );
302 return &driver->funcs;
307 if (!(module = LoadLibraryW( name )))
309 LeaveCriticalSection( &driver_section );
310 return NULL;
313 if (!(driver = create_driver( module )))
315 FreeLibrary( module );
316 LeaveCriticalSection( &driver_section );
317 return NULL;
320 TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
321 LeaveCriticalSection( &driver_section );
322 return &driver->funcs;
326 /**********************************************************************
327 * DRIVER_get_driver
329 * Get a new copy of an existing driver.
331 const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs )
333 struct graphics_driver *driver;
335 EnterCriticalSection( &driver_section );
336 for (driver = first_driver; driver; driver = driver->next)
337 if (&driver->funcs == funcs) break;
338 if (!driver) ERR( "driver not found, trouble ahead\n" );
339 driver->count++;
340 LeaveCriticalSection( &driver_section );
341 return funcs;
345 /**********************************************************************
346 * DRIVER_release_driver
348 * Release a driver by decrementing ref count and freeing it if needed.
350 void DRIVER_release_driver( const DC_FUNCTIONS *funcs )
352 struct graphics_driver *driver;
354 EnterCriticalSection( &driver_section );
356 for (driver = first_driver; driver; driver = driver->next)
357 if (&driver->funcs == funcs) break;
359 if (!driver) goto done;
360 if (--driver->count) goto done;
362 /* removed last reference, free it */
363 if (driver->next) driver->next->prev = driver->prev;
364 if (driver->prev) driver->prev->next = driver->next;
365 else first_driver = driver->next;
366 if (driver == display_driver) display_driver = NULL;
368 FreeLibrary( driver->module );
369 HeapFree( GetProcessHeap(), 0, driver );
370 done:
371 LeaveCriticalSection( &driver_section );
375 /*****************************************************************************
376 * DRIVER_GetDriverName
379 BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
381 static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
382 static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
383 static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
384 static const WCHAR empty_strW[] = { 0 };
385 WCHAR *p;
387 /* display is a special case */
388 if (!strcmpiW( device, displayW ) ||
389 !strcmpiW( device, display1W ))
391 lstrcpynW( driver, displayW, size );
392 return TRUE;
395 size = GetProfileStringW(devicesW, device, empty_strW, driver, size);
396 if(!size) {
397 WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
398 return FALSE;
400 p = strchrW(driver, ',');
401 if(!p)
403 WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device));
404 return FALSE;
406 *p = 0;
407 TRACE("Found %s for %s\n", debugstr_w(driver), debugstr_w(device));
408 return TRUE;
412 /***********************************************************************
413 * GdiConvertToDevmodeW (GDI32.@)
415 DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
417 DEVMODEW *dmW;
418 WORD dmW_size, dmA_size;
420 dmA_size = dmA->dmSize;
422 /* this is the minimal dmSize that XP accepts */
423 if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
424 return NULL;
426 if (dmA_size > sizeof(DEVMODEA))
427 dmA_size = sizeof(DEVMODEA);
429 dmW_size = dmA_size + CCHDEVICENAME;
430 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
431 dmW_size += CCHFORMNAME;
433 dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
434 if (!dmW) return NULL;
436 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, -1,
437 dmW->dmDeviceName, CCHDEVICENAME);
438 /* copy slightly more, to avoid long computations */
439 memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
441 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
443 if (dmA->dmFields & DM_FORMNAME)
444 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, -1,
445 dmW->dmFormName, CCHFORMNAME);
446 else
447 dmW->dmFormName[0] = 0;
449 if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
450 memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
453 if (dmA->dmDriverExtra)
454 memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
456 dmW->dmSize = dmW_size;
458 return dmW;
462 /*****************************************************************************
463 * @ [GDI32.100]
465 * This should thunk to 16-bit and simply call the proc with the given args.
467 INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
468 LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
470 FIXME("(%p, %p, %s, %s, %s)\n", lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
471 return -1;
474 /*****************************************************************************
475 * @ [GDI32.101]
477 * This should load the correct driver for lpszDevice and calls this driver's
478 * ExtDeviceModePropSheet proc.
480 * Note: The driver calls a callback routine for each property sheet page; these
481 * pages are supposed to be filled into the structure pointed to by lpPropSheet.
482 * The layout of this structure is:
484 * struct
486 * DWORD nPages;
487 * DWORD unknown;
488 * HPROPSHEETPAGE pages[10];
489 * };
491 INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
492 LPCSTR lpszPort, LPVOID lpPropSheet )
494 FIXME("(%p, %s, %s, %p)\n", hWnd, lpszDevice, lpszPort, lpPropSheet );
495 return -1;
498 /*****************************************************************************
499 * @ [GDI32.102]
501 * This should load the correct driver for lpszDevice and call this driver's
502 * ExtDeviceMode proc.
504 * FIXME: convert ExtDeviceMode to unicode in the driver interface
506 INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
507 LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
508 LPSTR lpszPort, LPDEVMODEA lpdmInput,
509 LPSTR lpszProfile, DWORD fwMode )
511 WCHAR deviceW[300];
512 WCHAR bufW[300];
513 char buf[300];
514 HDC hdc;
515 DC *dc;
516 INT ret = -1;
518 TRACE("(%p, %p, %s, %s, %p, %s, %d)\n",
519 hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode );
521 if (!lpszDevice) return -1;
522 if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
524 if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
526 if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
528 if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
530 if ((dc = get_dc_ptr( hdc )))
532 if (dc->funcs->pExtDeviceMode)
533 ret = dc->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
534 lpdmInput, lpszProfile, fwMode );
535 release_dc_ptr( dc );
537 DeleteDC( hdc );
538 return ret;
541 /****************************************************************************
542 * @ [GDI32.103]
544 * This should load the correct driver for lpszDevice and calls this driver's
545 * AdvancedSetupDialog proc.
547 INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
548 LPDEVMODEA devin, LPDEVMODEA devout )
550 TRACE("(%p, %s, %p, %p)\n", hwnd, lpszDevice, devin, devout );
551 return -1;
554 /*****************************************************************************
555 * @ [GDI32.104]
557 * This should load the correct driver for lpszDevice and calls this driver's
558 * DeviceCapabilities proc.
560 * FIXME: convert DeviceCapabilities to unicode in the driver interface
562 DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
563 WORD fwCapability, LPSTR lpszOutput,
564 LPDEVMODEA lpdm )
566 WCHAR deviceW[300];
567 WCHAR bufW[300];
568 char buf[300];
569 HDC hdc;
570 DC *dc;
571 INT ret = -1;
573 TRACE("(%s, %s, %d, %p, %p)\n", lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
575 if (!lpszDevice) return -1;
576 if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
578 if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
580 if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
582 if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
584 if ((dc = get_dc_ptr( hdc )))
586 if (dc->funcs->pDeviceCapabilities)
587 ret = dc->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
588 fwCapability, lpszOutput, lpdm );
589 release_dc_ptr( dc );
591 DeleteDC( hdc );
592 return ret;
596 /************************************************************************
597 * Escape [GDI32.@]
599 INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
601 INT ret;
602 POINT *pt;
604 switch (escape)
606 case ABORTDOC:
607 return AbortDoc( hdc );
609 case ENDDOC:
610 return EndDoc( hdc );
612 case GETPHYSPAGESIZE:
613 pt = out_data;
614 pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
615 pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
616 return 1;
618 case GETPRINTINGOFFSET:
619 pt = out_data;
620 pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
621 pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
622 return 1;
624 case GETSCALINGFACTOR:
625 pt = out_data;
626 pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
627 pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
628 return 1;
630 case NEWFRAME:
631 return EndPage( hdc );
633 case SETABORTPROC:
634 return SetAbortProc( hdc, (ABORTPROC)in_data );
636 case STARTDOC:
638 DOCINFOA doc;
639 char *name = NULL;
641 /* in_data may not be 0 terminated so we must copy it */
642 if (in_data)
644 name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
645 memcpy( name, in_data, in_count );
646 name[in_count] = 0;
648 /* out_data is actually a pointer to the DocInfo structure and used as
649 * a second input parameter */
650 if (out_data) doc = *(DOCINFOA *)out_data;
651 else
653 doc.cbSize = sizeof(doc);
654 doc.lpszOutput = NULL;
655 doc.lpszDatatype = NULL;
656 doc.fwType = 0;
658 doc.lpszDocName = name;
659 ret = StartDocA( hdc, &doc );
660 HeapFree( GetProcessHeap(), 0, name );
661 if (ret > 0) ret = StartPage( hdc );
662 return ret;
665 case QUERYESCSUPPORT:
667 const INT *ptr = (const INT *)in_data;
668 if (in_count < sizeof(INT)) return 0;
669 switch(*ptr)
671 case ABORTDOC:
672 case ENDDOC:
673 case GETPHYSPAGESIZE:
674 case GETPRINTINGOFFSET:
675 case GETSCALINGFACTOR:
676 case NEWFRAME:
677 case QUERYESCSUPPORT:
678 case SETABORTPROC:
679 case STARTDOC:
680 return TRUE;
682 break;
686 /* if not handled internally, pass it to the driver */
687 return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
691 /******************************************************************************
692 * ExtEscape [GDI32.@]
694 * Access capabilities of a particular device that are not available through GDI.
696 * PARAMS
697 * hdc [I] Handle to device context
698 * nEscape [I] Escape function
699 * cbInput [I] Number of bytes in input structure
700 * lpszInData [I] Pointer to input structure
701 * cbOutput [I] Number of bytes in output structure
702 * lpszOutData [O] Pointer to output structure
704 * RETURNS
705 * Success: >0
706 * Not implemented: 0
707 * Failure: <0
709 INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
710 INT cbOutput, LPSTR lpszOutData )
712 INT ret = 0;
713 DC * dc = get_dc_ptr( hdc );
714 if (dc)
716 if (dc->funcs->pExtEscape)
717 ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
718 release_dc_ptr( dc );
720 return ret;
724 /*******************************************************************
725 * DrawEscape [GDI32.@]
729 INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
731 FIXME("DrawEscape, stub\n");
732 return 0;
735 /*******************************************************************
736 * NamedEscape [GDI32.@]
738 INT WINAPI NamedEscape( HDC hdc, LPCWSTR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData,
739 INT cbOutput, LPSTR lpszOutData )
741 FIXME("(%p, %s, %d, %d, %p, %d, %p)\n",
742 hdc, wine_dbgstr_w(pDriver), nEscape, cbInput, lpszInData, cbOutput,
743 lpszOutData);
744 return 0;
747 /*******************************************************************
748 * DdQueryDisplaySettingsUniqueness [GDI32.@]
749 * GdiEntry13 [GDI32.@]
751 ULONG WINAPI DdQueryDisplaySettingsUniqueness(VOID)
753 static int warn_once;
755 if (!warn_once++)
756 FIXME("stub\n");
757 return 0;