userenv/tests: Enable compilation with long types.
[wine.git] / dlls / win32u / wrappers.c
blob642380480c64d6c8d37a2dc82588485211741390
1 /*
2 * Unix call wrappers
4 * Copyright 2021 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "ntstatus.h"
22 #define WIN32_NO_STATUS
23 #include "win32u_private.h"
25 static const struct unix_funcs *unix_funcs;
27 INT WINAPI NtGdiAbortDoc( HDC hdc )
29 if (!unix_funcs) return 0;
30 return unix_funcs->pNtGdiAbortDoc( hdc );
33 BOOL WINAPI NtGdiAbortPath( HDC hdc )
35 if (!unix_funcs) return FALSE;
36 return unix_funcs->pNtGdiAbortPath( hdc );
39 BOOL WINAPI NtGdiAlphaBlend( HDC hdc_dst, int x_dst, int y_dst, int width_dst, int height_dst,
40 HDC hdc_src, int x_src, int y_src, int width_src, int height_src,
41 BLENDFUNCTION blend_function, HANDLE xform )
43 if (!unix_funcs) return FALSE;
44 return unix_funcs->pNtGdiAlphaBlend( hdc_dst, x_dst, y_dst, width_dst, height_dst, hdc_src,
45 x_src, y_src, width_src, height_src, blend_function, xform );
48 BOOL WINAPI NtGdiAngleArc( HDC hdc, INT x, INT y, DWORD radius, FLOAT start_angle, FLOAT sweep_angle )
50 if (!unix_funcs) return FALSE;
51 return unix_funcs->pNtGdiAngleArc( hdc, x, y, radius, start_angle, sweep_angle );
54 BOOL WINAPI NtGdiArcInternal( UINT type, HDC hdc, INT left, INT top, INT right, INT bottom,
55 INT xstart, INT ystart, INT xend, INT yend )
57 if (!unix_funcs) return FALSE;
58 return unix_funcs->pNtGdiArcInternal( type, hdc, left, top, right, bottom, xstart, ystart, xend, yend );
61 BOOL WINAPI NtGdiBeginPath( HDC hdc )
63 if (!unix_funcs) return FALSE;
64 return unix_funcs->pNtGdiBeginPath( hdc );
67 BOOL WINAPI NtGdiBitBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width, INT height, HDC hdc_src,
68 INT x_src, INT y_src, DWORD rop, DWORD bk_color, FLONG fl )
70 if (!unix_funcs) return FALSE;
71 return unix_funcs->pNtGdiBitBlt( hdc_dst, x_dst, y_dst, width, height, hdc_src, x_src, y_src,
72 rop, bk_color, fl );
75 BOOL WINAPI NtGdiCloseFigure( HDC hdc )
77 if (!unix_funcs) return FALSE;
78 return unix_funcs->pNtGdiCloseFigure( hdc );
81 BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc )
83 if (!unix_funcs) return FALSE;
84 return unix_funcs->pNtGdiComputeXformCoefficients( hdc );
87 HBITMAP WINAPI NtGdiCreateCompatibleBitmap( HDC hdc, INT width, INT height )
89 if (!unix_funcs) return 0;
90 return unix_funcs->pNtGdiCreateCompatibleBitmap( hdc, width, height );
93 HDC WINAPI NtGdiCreateCompatibleDC( HDC hdc )
95 if (!unix_funcs) return 0;
96 return unix_funcs->pNtGdiCreateCompatibleDC( hdc );
99 HBITMAP WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWORD init,
100 const void *bits, const BITMAPINFO *data,
101 UINT coloruse, UINT max_info, UINT max_bits,
102 ULONG flags, HANDLE xform )
104 if (!unix_funcs) return 0;
105 return unix_funcs->pNtGdiCreateDIBitmapInternal( hdc, width, height, init, bits, data,
106 coloruse, max_info, max_bits, flags, xform );
109 HDC WINAPI NtGdiCreateMetafileDC( HDC hdc )
111 if (!unix_funcs) return 0;
112 return unix_funcs->pNtGdiCreateMetafileDC( hdc );
115 BOOL WINAPI NtGdiDeleteObjectApp( HGDIOBJ obj )
117 if (!unix_funcs) return FALSE;
118 return unix_funcs->pNtGdiDeleteObjectApp( obj );
121 LONG WINAPI NtGdiDoPalette( HGDIOBJ handle, WORD start, WORD count, void *entries,
122 DWORD func, BOOL inbound )
124 if (!unix_funcs) return 0;
125 return unix_funcs->pNtGdiDoPalette( handle, start, count, entries, func, inbound );
128 BOOL WINAPI NtGdiEllipse( HDC hdc, INT left, INT top, INT right, INT bottom )
130 if (!unix_funcs) return FALSE;
131 return unix_funcs->pNtGdiEllipse( hdc, left, top, right, bottom );
134 INT WINAPI NtGdiEndDoc( HDC hdc )
136 if (!unix_funcs) return SP_ERROR;
137 return unix_funcs->pNtGdiEndDoc( hdc );
140 BOOL WINAPI NtGdiEndPath( HDC hdc )
142 if (!unix_funcs) return FALSE;
143 return unix_funcs->pNtGdiEndPath( hdc );
146 INT WINAPI NtGdiEndPage( HDC hdc )
148 if (!unix_funcs) return SP_ERROR;
149 return unix_funcs->pNtGdiEndPage( hdc );
152 BOOL WINAPI NtGdiEnumFonts( HDC hdc, ULONG type, ULONG win32_compat, ULONG face_name_len,
153 const WCHAR *face_name, ULONG charset, ULONG *count, void *buf )
155 if (!unix_funcs) return FALSE;
156 return unix_funcs->pNtGdiEnumFonts( hdc, type, win32_compat, face_name_len, face_name,
157 charset, count, buf );
160 INT WINAPI NtGdiExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bottom )
162 if (!unix_funcs) return ERROR;
163 return unix_funcs->pNtGdiExcludeClipRect( hdc, left, top, right, bottom );
166 INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, INT driver_id, INT escape, INT input_size,
167 const char *input, INT output_size, char *output )
169 if (!unix_funcs) return 0;
170 return unix_funcs->pNtGdiExtEscape( hdc, driver, driver_id, escape, input_size, input,
171 output_size, output );
174 BOOL WINAPI NtGdiExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT type )
176 if (!unix_funcs) return FALSE;
177 return unix_funcs->pNtGdiExtFloodFill( hdc, x, y, color, type );
180 BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
181 const WCHAR *str, UINT count, const INT *dx, DWORD cp )
183 if (!unix_funcs) return FALSE;
184 return unix_funcs->pNtGdiExtTextOutW( hdc, x, y, flags, rect, str, count, dx, cp );
187 INT WINAPI NtGdiExtSelectClipRgn( HDC hdc, HRGN region, INT mode )
189 if (!unix_funcs) return ERROR;
190 return unix_funcs->pNtGdiExtSelectClipRgn( hdc, region, mode );
193 BOOL WINAPI NtGdiFillPath( HDC hdc )
195 if (!unix_funcs) return FALSE;
196 return unix_funcs->pNtGdiFillPath( hdc );
199 BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
201 if (!unix_funcs) return FALSE;
202 return unix_funcs->pNtGdiFillRgn( hdc, hrgn, hbrush );
205 BOOL WINAPI NtGdiFontIsLinked( HDC hdc )
207 if (!unix_funcs) return FALSE;
208 return unix_funcs->pNtGdiFontIsLinked( hdc );
211 BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height )
213 if (!unix_funcs) return FALSE;
214 return unix_funcs->pNtGdiFrameRgn( hdc, hrgn, brush, width, height );
217 BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD *result )
219 if (!unix_funcs) return FALSE;
220 return unix_funcs->pNtGdiGetAndSetDCDword( hdc, method, value, result );
223 INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect )
225 if (!unix_funcs) return ERROR;
226 return unix_funcs->pNtGdiGetAppClipBox( hdc, rect );
229 UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags )
231 if (!unix_funcs) return 0;
232 return unix_funcs->pNtGdiGetBoundsRect( hdc, rect, flags );
235 BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars,
236 ULONG flags, void *buffer )
238 if (!unix_funcs) return FALSE;
239 return unix_funcs->pNtGdiGetCharABCWidthsW( hdc, first, last, chars, flags, buffer );
242 BOOL WINAPI NtGdiGetCharWidthW( HDC hdc, UINT first_char, UINT last_char, WCHAR *chars,
243 ULONG flags, void *buffer )
245 if (!unix_funcs) return FALSE;
246 return unix_funcs->pNtGdiGetCharWidthW( hdc, first_char, last_char, chars, flags, buffer );
249 BOOL WINAPI NtGdiGetCharWidthInfo( HDC hdc, struct char_width_info *info )
251 if (!unix_funcs) return FALSE;
252 return unix_funcs->pNtGdiGetCharWidthInfo( hdc, info );
255 INT WINAPI NtGdiGetDIBitsInternal( HDC hdc, HBITMAP hbitmap, UINT startscan, UINT lines,
256 void *bits, BITMAPINFO *info, UINT coloruse,
257 UINT max_bits, UINT max_info )
259 if (!unix_funcs) return 0;
260 return unix_funcs->pNtGdiGetDIBitsInternal( hdc, hbitmap, startscan, lines, bits, info, coloruse,
261 max_bits, max_info );
264 INT WINAPI NtGdiGetDeviceCaps( HDC hdc, INT cap )
266 if (!unix_funcs) return 0;
267 return unix_funcs->pNtGdiGetDeviceCaps( hdc, cap );
270 BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr )
272 if (!unix_funcs) return FALSE;
273 return unix_funcs->pNtGdiGetDeviceGammaRamp( hdc, ptr );
276 DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length )
278 if (!unix_funcs) return GDI_ERROR;
279 return unix_funcs->pNtGdiGetFontData( hdc, table, offset, buffer, length );
282 DWORD WINAPI NtGdiGetFontUnicodeRanges( HDC hdc, GLYPHSET *lpgs )
284 if (!unix_funcs) return 0;
285 return unix_funcs->pNtGdiGetFontUnicodeRanges( hdc, lpgs );
288 DWORD WINAPI NtGdiGetGlyphIndicesW( HDC hdc, const WCHAR *str, INT count,
289 WORD *indices, DWORD flags )
291 if (!unix_funcs) return GDI_ERROR;
292 return unix_funcs->pNtGdiGetGlyphIndicesW( hdc, str, count, indices, flags );
295 DWORD WINAPI NtGdiGetGlyphOutline( HDC hdc, UINT ch, UINT format, GLYPHMETRICS *metrics,
296 DWORD size, void *buffer, const MAT2 *mat2,
297 BOOL ignore_rotation )
299 if (!unix_funcs) return GDI_ERROR;
300 return unix_funcs->pNtGdiGetGlyphOutline( hdc, ch, format, metrics, size, buffer, mat2, ignore_rotation );
303 DWORD WINAPI NtGdiGetKerningPairs( HDC hdc, DWORD count, KERNINGPAIR *kern_pair )
305 if (!unix_funcs) return 0;
306 return unix_funcs->pNtGdiGetKerningPairs( hdc, count, kern_pair );
309 COLORREF WINAPI NtGdiGetNearestColor( HDC hdc, COLORREF color )
311 if (!unix_funcs) return CLR_INVALID;
312 return unix_funcs->pNtGdiGetNearestColor( hdc, color );
315 UINT WINAPI NtGdiGetOutlineTextMetricsInternalW( HDC hdc, UINT cbData,
316 OUTLINETEXTMETRICW *otm, ULONG opts )
318 if (!unix_funcs) return 0;
319 return unix_funcs->pNtGdiGetOutlineTextMetricsInternalW( hdc, cbData, otm, opts );
322 COLORREF WINAPI NtGdiGetPixel( HDC hdc, INT x, INT y )
324 if (!unix_funcs) return CLR_INVALID;
325 return unix_funcs->pNtGdiGetPixel( hdc, x, y );
328 INT WINAPI NtGdiGetRandomRgn( HDC hdc, HRGN region, INT code )
330 if (!unix_funcs) return -1;
331 return unix_funcs->pNtGdiGetRandomRgn( hdc, region, code );
334 BOOL WINAPI NtGdiGetRasterizerCaps( RASTERIZER_STATUS *status, UINT size )
336 if (!unix_funcs) return FALSE;
337 return unix_funcs->pNtGdiGetRasterizerCaps( status, size );
340 BOOL WINAPI NtGdiGetRealizationInfo( HDC hdc, struct font_realization_info *info )
342 if (!unix_funcs) return FALSE;
343 return unix_funcs->pNtGdiGetRealizationInfo( hdc, info );
346 UINT WINAPI NtGdiGetTextCharsetInfo( HDC hdc, FONTSIGNATURE *fs, DWORD flags )
348 if (!unix_funcs) return DEFAULT_CHARSET;
349 return unix_funcs->pNtGdiGetTextCharsetInfo( hdc, fs, flags );
352 BOOL WINAPI NtGdiGetTextExtentExW( HDC hdc, const WCHAR *str, INT count, INT max_ext,
353 INT *nfit, INT *dxs, SIZE *size, UINT flags )
355 if (!unix_funcs) return FALSE;
356 return unix_funcs->pNtGdiGetTextExtentExW( hdc, str, count, max_ext, nfit, dxs, size, flags );
359 INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name, BOOL alias_name )
361 if (!unix_funcs) return 0;
362 return unix_funcs->pNtGdiGetTextFaceW( hdc, count, name, alias_name );
365 BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics, ULONG flags )
367 if (!unix_funcs) return FALSE;
368 return unix_funcs->pNtGdiGetTextMetricsW( hdc, metrics, flags );
371 BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
372 void *grad_array, ULONG ngrad, ULONG mode )
374 if (!unix_funcs) return FALSE;
375 return unix_funcs->pNtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
378 INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom )
380 if (!unix_funcs) return ERROR;
381 return unix_funcs->pNtGdiIntersectClipRect( hdc, left, top, right, bottom );
384 BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn )
386 if (!unix_funcs) return FALSE;
387 return unix_funcs->pNtGdiInvertRgn( hdc, hrgn );
390 BOOL WINAPI NtGdiLineTo( HDC hdc, INT x, INT y )
392 if (!unix_funcs) return FALSE;
393 return unix_funcs->pNtGdiLineTo( hdc, x, y );
396 BOOL WINAPI NtGdiMaskBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
397 HDC hdc_src, INT x_src, INT y_src, HBITMAP mask,
398 INT x_mask, INT y_mask, DWORD rop, DWORD bk_color )
400 if (!unix_funcs) return FALSE;
401 return unix_funcs->pNtGdiMaskBlt( hdc, x_dst, y_dst, width_dst, height_dst, hdc_src,
402 x_src, y_src, mask, x_mask, y_mask, rop, bk_color );
405 BOOL WINAPI NtGdiModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode )
407 if (!unix_funcs) return FALSE;
408 return unix_funcs->pNtGdiModifyWorldTransform( hdc, xform, mode );
411 BOOL WINAPI NtGdiMoveTo( HDC hdc, INT x, INT y, POINT *pt )
413 if (!unix_funcs) return FALSE;
414 return unix_funcs->pNtGdiMoveTo( hdc, x, y, pt );
417 INT WINAPI NtGdiOffsetClipRgn( HDC hdc, INT x, INT y )
419 if (!unix_funcs) return ERROR;
420 return unix_funcs->pNtGdiOffsetClipRgn( hdc, x, y );
423 HDC WINAPI NtGdiOpenDCW( UNICODE_STRING *device, const DEVMODEW *devmode,
424 UNICODE_STRING *output, ULONG type, BOOL is_display,
425 HANDLE hspool, DRIVER_INFO_2W *driver_info, void *pdev )
427 if (!unix_funcs) return 0;
428 return unix_funcs->pNtGdiOpenDCW( device, devmode, output, type, is_display,
429 hspool, driver_info, pdev );
432 BOOL WINAPI NtGdiPatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop )
434 if (!unix_funcs) return FALSE;
435 return unix_funcs->pNtGdiPatBlt( hdc, left, top, width, height, rop );
438 BOOL WINAPI NtGdiPlgBlt( HDC hdc, const POINT *point, HDC hdc_src, INT x_src, INT y_src,
439 INT width, INT height, HBITMAP mask, INT x_mask, INT y_mask,
440 DWORD bk_color )
442 if (!unix_funcs) return FALSE;
443 return unix_funcs->pNtGdiPlgBlt( hdc, point, hdc_src, x_src, y_src, width, height, mask,
444 x_mask, y_mask, bk_color );
447 BOOL WINAPI NtGdiPolyDraw( HDC hdc, const POINT *points, const BYTE *types, DWORD count )
449 if (!unix_funcs) return FALSE;
450 return unix_funcs->pNtGdiPolyDraw( hdc, points, types, count );
453 ULONG WINAPI NtGdiPolyPolyDraw( HDC hdc, const POINT *points, const ULONG *counts,
454 DWORD count, UINT function )
456 if (!unix_funcs) return 0;
457 return unix_funcs->pNtGdiPolyPolyDraw( hdc, points, counts, count, function );
460 BOOL WINAPI NtGdiPtVisible( HDC hdc, INT x, INT y )
462 if (!unix_funcs) return FALSE;
463 return unix_funcs->pNtGdiPtVisible( hdc, x, y );
466 BOOL WINAPI NtGdiRectVisible( HDC hdc, const RECT *rect )
468 if (!unix_funcs) return FALSE;
469 return unix_funcs->pNtGdiRectVisible( hdc, rect );
472 BOOL WINAPI NtGdiRectangle( HDC hdc, INT left, INT top, INT right, INT bottom )
474 if (!unix_funcs) return FALSE;
475 return unix_funcs->pNtGdiRectangle( hdc, left, top, right, bottom );
478 BOOL WINAPI NtGdiResetDC( HDC hdc, const DEVMODEW *devmode, BOOL *banding,
479 DRIVER_INFO_2W *driver_info, void *dev )
481 if (!unix_funcs) return FALSE;
482 return unix_funcs->pNtGdiResetDC( hdc, devmode, banding, driver_info, dev );
485 BOOL WINAPI NtGdiResizePalette( HPALETTE palette, UINT count )
487 if (!unix_funcs) return FALSE;
488 return unix_funcs->pNtGdiResizePalette( palette, count );
491 BOOL WINAPI NtGdiRestoreDC( HDC hdc, INT level )
493 if (!unix_funcs) return FALSE;
494 return unix_funcs->pNtGdiRestoreDC( hdc, level );
497 BOOL WINAPI NtGdiRoundRect( HDC hdc, INT left, INT top, INT right,
498 INT bottom, INT ell_width, INT ell_height )
500 if (!unix_funcs) return FALSE;
501 return unix_funcs->pNtGdiRoundRect( hdc, left, top, right, bottom, ell_width, ell_height );
504 BOOL WINAPI NtGdiScaleViewportExtEx( HDC hdc, INT x_num, INT x_denom,
505 INT y_num, INT y_denom, SIZE *size )
507 if (!unix_funcs) return FALSE;
508 return unix_funcs->pNtGdiScaleViewportExtEx( hdc, x_num, x_denom, y_num, y_denom, size );
511 BOOL WINAPI NtGdiScaleWindowExtEx( HDC hdc, INT x_num, INT x_denom,
512 INT y_num, INT y_denom, SIZE *size )
514 if (!unix_funcs) return FALSE;
515 return unix_funcs->pNtGdiScaleWindowExtEx( hdc, x_num, x_denom, y_num, y_denom, size );
518 HGDIOBJ WINAPI NtGdiSelectBitmap( HDC hdc, HGDIOBJ handle )
520 if (!unix_funcs) return 0;
521 return unix_funcs->pNtGdiSelectBitmap( hdc, handle );
524 HGDIOBJ WINAPI NtGdiSelectBrush( HDC hdc, HGDIOBJ handle )
526 if (!unix_funcs) return 0;
527 return unix_funcs->pNtGdiSelectBrush( hdc, handle );
530 BOOL WINAPI NtGdiSelectClipPath( HDC hdc, INT mode )
532 if (!unix_funcs) return FALSE;
533 return unix_funcs->pNtGdiSelectClipPath( hdc, mode );
536 HGDIOBJ WINAPI NtGdiSelectFont( HDC hdc, HGDIOBJ handle )
538 if (!unix_funcs) return 0;
539 return unix_funcs->pNtGdiSelectFont( hdc, handle );
542 HGDIOBJ WINAPI NtGdiSelectPen( HDC hdc, HGDIOBJ handle )
544 if (!unix_funcs) return 0;
545 return unix_funcs->pNtGdiSelectPen( hdc, handle );
548 UINT WINAPI NtGdiSetBoundsRect( HDC hdc, const RECT *rect, UINT flags )
550 if (!unix_funcs) return 0;
551 return unix_funcs->pNtGdiSetBoundsRect( hdc, rect, flags );
554 INT WINAPI NtGdiSetDIBitsToDeviceInternal( HDC hdc, INT x_dst, INT y_dst, DWORD cx,
555 DWORD cy, INT x_src, INT y_src, UINT startscan,
556 UINT lines, const void *bits, const BITMAPINFO *bmi,
557 UINT coloruse, UINT max_bits, UINT max_info,
558 BOOL xform_coords, HANDLE xform )
560 if (!unix_funcs) return 0;
561 return unix_funcs->pNtGdiSetDIBitsToDeviceInternal( hdc, x_dst, y_dst, cx, cy, x_src, y_src,
562 startscan, lines, bits, bmi, coloruse,
563 max_bits, max_info, xform_coords, xform );
566 BOOL WINAPI NtGdiSetDeviceGammaRamp( HDC hdc, void *ptr )
568 if (!unix_funcs) return FALSE;
569 return unix_funcs->pNtGdiSetDeviceGammaRamp( hdc, ptr );
572 DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout )
574 if (!unix_funcs) return GDI_ERROR;
575 return unix_funcs->pNtGdiSetLayout( hdc, wox, layout );
578 COLORREF WINAPI NtGdiSetPixel( HDC hdc, INT x, INT y, COLORREF color )
580 if (!unix_funcs) return CLR_INVALID;
581 return unix_funcs->pNtGdiSetPixel( hdc, x, y, color );
584 UINT WINAPI NtGdiSetSystemPaletteUse( HDC hdc, UINT use )
586 if (!unix_funcs) return SYSPAL_ERROR;
587 return unix_funcs->pNtGdiSetSystemPaletteUse( hdc, use );
590 INT WINAPI NtGdiStartDoc( HDC hdc, const DOCINFOW *doc, BOOL *banding, INT job )
592 if (!unix_funcs) return SP_ERROR;
593 return unix_funcs->pNtGdiStartDoc( hdc, doc, banding, job );
596 INT WINAPI NtGdiStartPage( HDC hdc )
598 if (!unix_funcs) return SP_ERROR;
599 return unix_funcs->pNtGdiStartPage( hdc );
602 BOOL WINAPI NtGdiStretchBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
603 HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
604 DWORD rop, COLORREF bk_color )
606 if (!unix_funcs) return FALSE;
607 return unix_funcs->pNtGdiStretchBlt( hdc, x_dst, y_dst, width_dst, height_dst, hdc_src,
608 x_src, y_src, width_src, height_src, rop, bk_color );
611 INT WINAPI NtGdiStretchDIBitsInternal( HDC hdc, INT x_dst, INT y_dst, INT width_dst,
612 INT height_dst, INT x_src, INT y_src, INT width_src,
613 INT height_src, const void *bits, const BITMAPINFO *bmi,
614 UINT coloruse, DWORD rop, UINT max_info, UINT max_bits,
615 HANDLE xform )
617 if (!unix_funcs) return 0;
618 return unix_funcs->pNtGdiStretchDIBitsInternal( hdc, x_dst, y_dst, width_dst, height_dst,
619 x_src, y_src, width_src, height_src, bits, bmi,
620 coloruse, rop, max_info, max_bits, xform );
623 BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc )
625 if (!unix_funcs) return FALSE;
626 return unix_funcs->pNtGdiStrokeAndFillPath( hdc );
629 BOOL WINAPI NtGdiStrokePath( HDC hdc )
631 if (!unix_funcs) return FALSE;
632 return unix_funcs->pNtGdiStrokePath( hdc );
635 BOOL WINAPI NtGdiTransparentBlt( HDC hdc, int x_dst, int y_dst, int width_dst, int height_dst,
636 HDC hdc_src, int x_src, int y_src, int width_src, int height_src,
637 UINT color )
639 if (!unix_funcs) return FALSE;
640 return unix_funcs->pNtGdiTransparentBlt( hdc, x_dst, y_dst, width_dst, height_dst, hdc_src,
641 x_src, y_src, width_src, height_src, color );
644 BOOL WINAPI NtGdiUnrealizeObject( HGDIOBJ obj )
646 if (!unix_funcs) return FALSE;
647 return unix_funcs->pNtGdiUnrealizeObject( obj );
650 BOOL WINAPI NtGdiUpdateColors( HDC hdc )
652 if (!unix_funcs) return FALSE;
653 return unix_funcs->pNtGdiUpdateColors( hdc );
656 BOOL WINAPI NtGdiWidenPath( HDC hdc )
658 if (!unix_funcs) return FALSE;
659 return unix_funcs->pNtGdiWidenPath( hdc );
662 NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
664 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
665 return unix_funcs->pNtGdiDdDDICheckVidPnExclusiveOwnership( desc );
668 NTSTATUS WINAPI NtGdiDdDDICreateDCFromMemory( D3DKMT_CREATEDCFROMMEMORY *desc )
670 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
671 return unix_funcs->pNtGdiDdDDICreateDCFromMemory( desc );
674 NTSTATUS WINAPI NtGdiDdDDIDestroyDCFromMemory( const D3DKMT_DESTROYDCFROMMEMORY *desc )
676 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
677 return unix_funcs->pNtGdiDdDDIDestroyDCFromMemory( desc );
680 NTSTATUS WINAPI NtGdiDdDDIDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
682 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
683 return unix_funcs->pNtGdiDdDDIDestroyDevice( desc );
686 NTSTATUS WINAPI NtGdiDdDDIEscape( const D3DKMT_ESCAPE *desc )
688 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
689 return unix_funcs->pNtGdiDdDDIEscape( desc );
692 NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
694 if (!unix_funcs) return STATUS_NOT_SUPPORTED;
695 return unix_funcs->pNtGdiDdDDISetVidPnSourceOwner( desc );
698 HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
700 if (!unix_funcs) return 0;
701 return unix_funcs->pNtUserActivateKeyboardLayout( layout, flags );
704 LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam )
706 if (!unix_funcs) return 0;
707 return unix_funcs->pNtUserCallNextHookEx( hhook, code, wparam, lparam );
710 ULONG_PTR WINAPI NtUserCallNoParam( ULONG code )
712 if (!unix_funcs) return 0;
713 return unix_funcs->pNtUserCallNoParam( code );
716 ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
718 if (!unix_funcs) return 0;
719 return unix_funcs->pNtUserCallOneParam( arg, code );
722 ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code )
724 if (!unix_funcs) return 0;
725 return unix_funcs->pNtUserCallTwoParam( arg1, arg2, code );
728 DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
730 if (!unix_funcs) return 0;
731 return unix_funcs->pNtUserCallHwnd( hwnd, code );
734 ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
736 if (!unix_funcs) return 0;
737 return unix_funcs->pNtUserCallHwndParam( hwnd, param, code );
740 LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd,
741 DWORD flags, void *lparam )
743 if (!unix_funcs) return DISP_CHANGE_FAILED;
744 return unix_funcs->pNtUserChangeDisplaySettings( devname, devmode, hwnd, flags, lparam );
747 BOOL WINAPI NtUserClipCursor( const RECT *rect )
749 if (!unix_funcs) return FALSE;
750 return unix_funcs->pNtUserClipCursor( rect );
753 INT WINAPI NtUserCountClipboardFormats(void)
755 if (!unix_funcs) return 0;
756 return unix_funcs->pNtUserCountClipboardFormats();
759 BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg )
761 if (!unix_funcs) return FALSE;
762 return unix_funcs->pNtUserDestroyCursor( cursor, arg );
765 BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
766 INT height, UINT istep, HBRUSH hbr, UINT flags )
768 if (!unix_funcs) return FALSE;
769 return unix_funcs->pNtUserDrawIconEx( hdc, x0, y0, icon, width, height, istep, hbr, flags );
772 NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
773 DISPLAY_DEVICEW *info, DWORD flags )
775 if (!unix_funcs) return FALSE;
776 return unix_funcs->pNtUserEnumDisplayDevices( device, index, info, flags );
779 BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp )
781 if (!unix_funcs) return FALSE;
782 return unix_funcs->pNtUserEnumDisplayMonitors( hdc, rect, proc, lp );
785 BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
786 DEVMODEW *dev_mode, DWORD flags )
788 if (!unix_funcs) return FALSE;
789 return unix_funcs->pNtUserEnumDisplaySettings( device, mode, dev_mode, flags );
792 SHORT WINAPI NtUserGetAsyncKeyState( INT key )
794 if (!unix_funcs) return 0;
795 return unix_funcs->pNtUserGetAsyncKeyState( key );
798 ATOM WINAPI NtUserGetClassInfoEx( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,
799 struct client_menu_name *menu_name, BOOL ansi )
801 if (!unix_funcs) return FALSE;
802 return unix_funcs->pNtUserGetClassInfoEx( instance, name, wc, menu_name, ansi );
805 BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
807 if (!unix_funcs) return FALSE;
808 return unix_funcs->pNtUserGetCursorInfo( info );
811 LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info,
812 UINT32 *num_mode_info )
814 if (!unix_funcs) return ERROR_NOT_SUPPORTED;
815 return unix_funcs->pNtUserGetDisplayConfigBufferSizes( flags, num_path_info, num_mode_info );
818 BOOL WINAPI NtUserGetIconInfo( HICON icon, ICONINFO *info, UNICODE_STRING *module,
819 UNICODE_STRING *res_name, DWORD *bpp, LONG unk )
821 if (!unix_funcs) return FALSE;
822 return unix_funcs->pNtUserGetIconInfo( icon, info, module, res_name, bpp, unk );
825 UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
827 if (!unix_funcs) return 0;
828 return unix_funcs->pNtUserGetKeyboardLayoutList( size, layouts );
831 INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size )
833 if (!unix_funcs) return 0;
834 return unix_funcs->pNtUserGetKeyNameText( lparam, buffer, size );
837 INT WINAPI NtUserGetPriorityClipboardFormat( UINT *list, INT count )
839 if (!unix_funcs) return 0;
840 return unix_funcs->pNtUserGetPriorityClipboardFormat( list, count );
843 DWORD WINAPI NtUserGetQueueStatus( UINT flags )
845 if (!unix_funcs) return 0;
846 return unix_funcs->pNtUserGetQueueStatus( flags );
849 BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size )
851 if (!unix_funcs) return FALSE;
852 return unix_funcs->pNtUserGetUpdatedClipboardFormats( formats, size, out_size );
855 BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format )
857 if (!unix_funcs) return FALSE;
858 return unix_funcs->pNtUserIsClipboardFormatAvailable( format );
861 UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout )
863 if (!unix_funcs) return -1;
864 return unix_funcs->pNtUserMapVirtualKeyEx( code, type, layout );
867 ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *name, UNICODE_STRING *version,
868 struct client_menu_name *client_menu_name, DWORD fnid, DWORD flags,
869 DWORD *wow )
871 if (!unix_funcs) return 0;
872 return unix_funcs->pNtUserRegisterClassExWOW( wc, name, version, client_menu_name, fnid, flags, wow );
875 BOOL WINAPI NtUserRegisterHotKey( HWND hwnd, INT id, UINT modifiers, UINT vk )
877 if (!unix_funcs) return FALSE;
878 return unix_funcs->pNtUserRegisterHotKey( hwnd, id, modifiers, vk );
881 BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
882 HRGN ret_update_rgn, RECT *update_rect )
884 if (!unix_funcs) return FALSE;
885 return unix_funcs->pNtUserScrollDC( hdc, dx, dy, scroll, clip, ret_update_rgn, update_rect );
888 HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
890 if (!unix_funcs) return 0;
891 return unix_funcs->pNtUserSelectPalette( hdc, hpal, bkg );
894 HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor )
896 if (!unix_funcs) return 0;
897 return unix_funcs->pNtUserSetCursor( cursor );
900 DWORD WINAPI NtUserSetClassLong( HWND hwnd, INT offset, LONG newval, BOOL ansi )
902 if (!unix_funcs) return 0;
903 return unix_funcs->pNtUserSetClassLong( hwnd, offset, newval, ansi );
906 ULONG_PTR WINAPI NtUserSetClassLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi )
908 if (!unix_funcs) return 0;
909 return unix_funcs->pNtUserSetClassLongPtr( hwnd, offset, newval, ansi );
912 WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval )
914 if (!unix_funcs) return 0;
915 return unix_funcs->pNtUserSetClassWord( hwnd, offset, newval );
918 BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name,
919 struct cursoricon_desc *desc )
921 if (!unix_funcs) return FALSE;
922 return unix_funcs->pNtUserSetCursorIconData( cursor, module, res_name, desc );
925 BOOL WINAPI NtUserSetCursorPos( INT x, INT y )
927 if (!unix_funcs) return FALSE;
928 return unix_funcs->pNtUserSetCursorPos( x, y );
931 BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values )
933 if (!unix_funcs) return FALSE;
934 return unix_funcs->pNtUserSetSysColors( count, colors, values );
937 INT WINAPI NtUserShowCursor( BOOL show )
939 if (!unix_funcs) return 0;
940 return unix_funcs->pNtUserShowCursor( show );
943 BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, PVOID ptr, UINT winini )
945 if (!unix_funcs) return FALSE;
946 return unix_funcs->pNtUserSystemParametersInfo( action, val, ptr, winini );
949 BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, UINT winini, UINT dpi )
951 if (!unix_funcs) return FALSE;
952 return unix_funcs->pNtUserSystemParametersInfoForDpi( action, val, ptr, winini, dpi );
955 INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
956 WCHAR *str, int size, UINT flags, HKL layout )
958 if (!unix_funcs) return 0;
959 return unix_funcs->pNtUserToUnicodeEx( virt, scan, state, str, size, flags, layout );
962 BOOL WINAPI NtUserUnregisterClass( UNICODE_STRING *name, HINSTANCE instance,
963 struct client_menu_name *client_menu_name )
965 if (!unix_funcs) return FALSE;
966 return unix_funcs->pNtUserUnregisterClass( name, instance, client_menu_name );
969 BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id )
971 if (!unix_funcs) return FALSE;
972 return unix_funcs->pNtUserUnregisterHotKey( hwnd, id );
975 WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout )
977 if (!unix_funcs) return 0;
978 return unix_funcs->pNtUserVkKeyScanEx( chr, layout );
981 DWORD_PTR WINAPI GetDCHook( HDC hdc, DCHOOKPROC *proc )
983 if (!unix_funcs) return 0;
984 return unix_funcs->pGetDCHook( hdc, proc );
987 BOOL WINAPI SetDCHook( HDC hdc, DCHOOKPROC proc, DWORD_PTR data )
989 if (!unix_funcs) return FALSE;
990 return unix_funcs->pSetDCHook( hdc, proc, data );
993 INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
994 UINT lines, const void *bits, const BITMAPINFO *info,
995 UINT coloruse )
997 if (!unix_funcs) return 0;
998 return unix_funcs->pSetDIBits( hdc, hbitmap, startscan, lines, bits, info, coloruse );
1001 WORD WINAPI SetHookFlags( HDC hdc, WORD flags )
1003 if (!unix_funcs) return 0;
1004 return unix_funcs->pSetHookFlags( hdc, flags );
1007 BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename )
1009 if (!unix_funcs) return FALSE;
1010 return unix_funcs->get_icm_profile( hdc, allow_default, size, filename );
1013 void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect,
1014 struct window_surface *surface )
1016 if (!unix_funcs) return;
1017 unix_funcs->set_visible_region( hdc, hrgn, vis_rect, device_rect, surface );
1020 BOOL CDECL __wine_get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage )
1022 if (!unix_funcs) return FALSE;
1023 return unix_funcs->get_brush_bitmap_info( handle, info, bits, usage );
1026 BOOL CDECL __wine_get_file_outline_text_metric( const WCHAR *path, OUTLINETEXTMETRICW *otm )
1028 if (!unix_funcs) return FALSE;
1029 return unix_funcs->get_file_outline_text_metric( path, otm );
1032 const struct vulkan_funcs * CDECL __wine_get_vulkan_driver(UINT version)
1034 if (!unix_funcs) return NULL;
1035 return unix_funcs->get_vulkan_driver( version );
1038 struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
1040 if (!unix_funcs) return NULL;
1041 return unix_funcs->get_wgl_driver( hdc, version );
1044 /***********************************************************************
1045 * __wine_set_display_driver (win32u.@)
1047 void CDECL __wine_set_display_driver( struct user_driver_funcs *funcs, UINT version )
1049 if (!unix_funcs) return;
1050 return unix_funcs->set_display_driver( funcs, version );
1053 extern void wrappers_init( unixlib_handle_t handle )
1055 const void *args;
1056 if (!__wine_unix_call( handle, 1, &args )) unix_funcs = args;