[PATCH 0/5] MR10763: opengl32: Generate code to call the get_integer hooks.
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/make_opengl | 28 +++++++++++++++++++--------- dlls/opengl32/private.h | 1 + dlls/opengl32/thunks.c | 18 ------------------ dlls/opengl32/thunks.h | 20 ++++++++++++++++++++ 4 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 dlls/opengl32/thunks.h diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index c6bee6f1ab4..0991d968516 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -1561,6 +1561,25 @@ print OUT "#define UNIX_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, para print OUT "#endif /* __WINE_OPENGL32_UNIXLIB_H */\n"; close OUT; + +# +# Generate the thunks.h file +# +open OUT, ">thunks.h" or die "cannot create thunks.h"; +print OUT "/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */\n\n"; + +foreach (sort keys %ext_functions) +{ + next unless is_exposed_function( $ext_functions{$_} ); + next unless defined $manual_win_functions{$_} || $manual_win_thunks{$_}; + my $decl_args = get_func_args( $ext_functions{$_} ); + my $func_ret = get_func_ret( $ext_functions{$_} ); + printf OUT "extern %s WINAPI %s(%s);\n", $func_ret, $_, $decl_args; +} + +close OUT; + + # # Generate the thunks.c file # @@ -1602,15 +1621,6 @@ foreach (sort keys %ext_functions) } print OUT "\n"; -foreach (sort keys %ext_functions) -{ - next unless is_exposed_function( $ext_functions{$_} ); - next unless defined $manual_win_functions{$_} || $manual_win_thunks{$_}; - my $decl_args = get_func_args( $ext_functions{$_} ); - my $func_ret = get_func_ret( $ext_functions{$_} ); - printf OUT "extern %s WINAPI %s(%s);\n", $func_ret, $_, $decl_args; -} - print OUT "const void *extension_procs[] =\n"; print OUT "{\n"; foreach (sort keys %ext_functions) diff --git a/dlls/opengl32/private.h b/dlls/opengl32/private.h index 7543f868d00..3c3a218e31a 100644 --- a/dlls/opengl32/private.h +++ b/dlls/opengl32/private.h @@ -27,6 +27,7 @@ #include "winternl.h" #include "wingdi.h" #include "wine/opengl_driver.h" +#include "thunks.h" struct registry_entry { diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index ed8b7cce5dc..8e555b037b5 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -24784,24 +24784,6 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) return args.ret; } -extern GLsync WINAPI glCreateSyncFromCLeventARB( struct _cl_context *context, struct _cl_event *event, GLbitfield flags ); -extern void WINAPI glDeleteSync( GLsync sync ); -extern GLsync WINAPI glFenceSync( GLenum condition, GLbitfield flags ); -extern void WINAPI glGetInteger64v( GLenum pname, GLint64 *data ); -extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ); -extern GLsync WINAPI glImportSyncEXT( GLenum external_sync_type, GLintptr external_sync, GLbitfield flags ); -extern BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); -extern HGLRC WINAPI wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList ); -extern HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ); -extern BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB hPbuffer ); -extern HDC WINAPI wglGetCurrentReadDCARB(void); -extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ); -extern const char * WINAPI wglGetExtensionsStringEXT(void); -extern BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues ); -extern BOOL WINAPI wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues ); -extern BOOL WINAPI wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, HGLRC hglrc ); -extern const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute ); -extern const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ); const void *extension_procs[] = { glAccumxOES, diff --git a/dlls/opengl32/thunks.h b/dlls/opengl32/thunks.h new file mode 100644 index 00000000000..c59ae7ff2c9 --- /dev/null +++ b/dlls/opengl32/thunks.h @@ -0,0 +1,20 @@ +/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */ + +extern GLsync WINAPI glCreateSyncFromCLeventARB( struct _cl_context *context, struct _cl_event *event, GLbitfield flags ); +extern void WINAPI glDeleteSync( GLsync sync ); +extern GLsync WINAPI glFenceSync( GLenum condition, GLbitfield flags ); +extern void WINAPI glGetInteger64v( GLenum pname, GLint64 *data ); +extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ); +extern GLsync WINAPI glImportSyncEXT( GLenum external_sync_type, GLintptr external_sync, GLbitfield flags ); +extern BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); +extern HGLRC WINAPI wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList ); +extern HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ); +extern BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB hPbuffer ); +extern HDC WINAPI wglGetCurrentReadDCARB(void); +extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ); +extern const char * WINAPI wglGetExtensionsStringEXT(void); +extern BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues ); +extern BOOL WINAPI wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues ); +extern BOOL WINAPI wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, HGLRC hglrc ); +extern const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute ); +extern const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10763
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/tests/opengl.c | 10 ++++----- dlls/opengl32/unix_thunks.c | 29 ------------------------- dlls/opengl32/unix_thunks.h | 1 - dlls/opengl32/unix_wgl.c | 41 +++--------------------------------- dlls/opengl32/unixlib.h | 9 -------- dlls/opengl32/wgl.c | 21 ++++++------------ dlls/win32u/opengl.c | 7 +----- 8 files changed, 16 insertions(+), 104 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 0991d968516..195fa2972c7 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -143,6 +143,7 @@ my %manual_win_functions = "wglGetExtensionsStringEXT" => 1, "wglGetLayerPaletteEntries" => 1, "wglGetProcAddress" => 1, + "wglMakeCurrent" => 1, "wglRealizeLayerPalette" => 1, "wglSetLayerPaletteEntries" => 1, "wglSwapLayerBuffers" => 1, @@ -174,7 +175,6 @@ my %manual_win_thunks = "wglGetPixelFormatAttribfvARB" => 1, "wglGetPixelFormatAttribivARB" => 1, "wglMakeContextCurrentARB" => 1, - "wglMakeCurrent" => 1, "wglQueryCurrentRendererStringWINE" => 1, "wglQueryRendererStringWINE" => 1, "wglSwapBuffers" => 1, diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 64434c5143b..aa12a776d46 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -1446,9 +1446,8 @@ static void test_makecurrent(HDC winhdc) SetLastError( 0xdeadbeef ); ret = wglMakeCurrent( NULL, NULL ); - ok( !ret || broken(ret) /* nt4 */, "wglMakeCurrent succeeded\n" ); - if (!ret) ok( GetLastError() == ERROR_INVALID_HANDLE, - "Expected ERROR_INVALID_HANDLE, got error=%lx\n", GetLastError() ); + ok( !ret, "wglMakeCurrent succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got error=%lx\n", GetLastError() ); ret = wglMakeCurrent( winhdc, NULL ); ok( ret, "wglMakeCurrent failed\n" ); @@ -1463,9 +1462,8 @@ static void test_makecurrent(HDC winhdc) SetLastError( 0xdeadbeef ); ret = wglMakeCurrent( NULL, NULL ); - ok( !ret || broken(ret) /* nt4 */, "wglMakeCurrent succeeded\n" ); - if (!ret) ok( GetLastError() == ERROR_INVALID_HANDLE, - "Expected ERROR_INVALID_HANDLE, got error=%lx\n", GetLastError() ); + ok( !ret, "wglMakeCurrent succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got error=%lx\n", GetLastError() ); ret = wglMakeCurrent( winhdc, hglrc ); ok( ret, "wglMakeCurrent failed\n" ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index d9874a9803c..35c7831fb1d 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -58,13 +58,6 @@ static NTSTATUS wgl_wglGetPixelFormat( void *args ) return STATUS_SUCCESS; } -static NTSTATUS wgl_wglMakeCurrent( void *args ) -{ - struct wglMakeCurrent_params *params = args; - params->ret = wrap_wglMakeCurrent( params->teb, params->hDc, params->newContext ); - return STATUS_SUCCESS; -} - static NTSTATUS wgl_wglSetPixelFormat( void *args ) { struct wglSetPixelFormat_params *params = args; @@ -30580,7 +30573,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = wgl_wglCreateContext, wgl_wglDeleteContext, wgl_wglGetPixelFormat, - wgl_wglMakeCurrent, wgl_wglSetPixelFormat, wgl_wglShareLists, wgl_wglSwapBuffers, @@ -33746,20 +33738,6 @@ static NTSTATUS wow64_wgl_wglGetPixelFormat( void *args ) return STATUS_SUCCESS; } -static NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDc; - PTR32 newContext; - BOOL ret; - } *params = args; - TEB *teb = get_teb64( params->teb ); - params->ret = wrap_wglMakeCurrent( teb, ULongToPtr(params->hDc), ULongToPtr(params->newContext) ); - return STATUS_SUCCESS; -} - static NTSTATUS wow64_wgl_wglSetPixelFormat( void *args ) { struct @@ -87004,7 +86982,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = wow64_wgl_wglCreateContext, wow64_wgl_wglDeleteContext, wow64_wgl_wglGetPixelFormat, - wow64_wgl_wglMakeCurrent, wow64_wgl_wglSetPixelFormat, wow64_wgl_wglShareLists, wow64_wgl_wglSwapBuffers, @@ -90126,11 +90103,6 @@ static int null_wglGetPixelFormat( HDC hdc ) RtlSetLastWin32Error( ERROR_INVALID_PIXEL_FORMAT ); return 0; } -static BOOL null_wglMakeCurrent( HDC hDc, HGLRC newContext ) -{ - WARN( "unsupported\n" ); - return 0; -} static BOOL null_wglSetPixelFormat( HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd ) { WARN( "unsupported\n" ); @@ -91505,7 +91477,6 @@ struct opengl_funcs null_opengl_funcs = .p_wglCreateContext = null_wglCreateContext, .p_wglDeleteContext = null_wglDeleteContext, .p_wglGetPixelFormat = null_wglGetPixelFormat, - .p_wglMakeCurrent = null_wglMakeCurrent, .p_wglSetPixelFormat = null_wglSetPixelFormat, .p_wglShareLists = null_wglShareLists, .p_wglSwapBuffers = null_wglSwapBuffers, diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 02cf89eedbf..700f857fa29 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -5,7 +5,6 @@ typedef ULONG PTR32; extern BOOL wrap_wglCopyContext( TEB *teb, HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ); extern HGLRC wrap_wglCreateContext( TEB *teb, HDC hDc, HGLRC handle ); extern BOOL wrap_wglDeleteContext( TEB *teb, HGLRC oldContext ); -extern BOOL wrap_wglMakeCurrent( TEB *teb, HDC hDc, HGLRC newContext ); extern BOOL wrap_wglShareLists( TEB *teb, HGLRC hrcSrvShare, HGLRC hrcSrvSource ); extern BOOL wrap_wglSwapBuffers( TEB *teb, HDC hdc ); extern void wrap_glClear( TEB *teb, GLbitfield mask, PFN_glClear func ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index e5386290538..6db14e54418 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -316,7 +316,7 @@ static BOOL copy_context_attributes( TEB *teb, HGLRC client_dst, struct context return FALSE; } - funcs->p_wglMakeCurrent( hdc, client_dst ); + funcs->p_wglMakeContextCurrentARB( hdc, hdc, client_dst ); if (mask & GL_COLOR_BUFFER_BIT) { @@ -369,8 +369,7 @@ static BOOL copy_context_attributes( TEB *teb, HGLRC client_dst, struct context } dst->used |= (src->used & mask); - if (!old_ctx) funcs->p_wglMakeCurrent( NULL, NULL ); - else if (!old_funcs->p_wglMakeContextCurrentARB) old_funcs->p_wglMakeCurrent( draw_hdc, old_ctx->client ); + if (!old_ctx) funcs->p_wglMakeContextCurrentARB( NULL, NULL, NULL ); else old_funcs->p_wglMakeContextCurrentARB( draw_hdc, read_hdc, old_ctx->client ); NtUserReleaseDC( hwnd, hdc ); @@ -1143,40 +1142,6 @@ static void make_context_current( TEB *teb, const struct opengl_funcs *funcs, HD if (TRACE_ON(opengl)) for (i = 0; i < count; i++) TRACE( "++ %s\n", all_extensions[client->extension_array[i]].name ); } -BOOL wrap_wglMakeCurrent( TEB *teb, HDC hdc, HGLRC client_context ) -{ - DWORD tid = HandleToULong(teb->ClientId.UniqueThread); - struct context *ctx, *prev = get_current_context( teb, NULL, NULL ); - - if (client_context) - { - const struct opengl_funcs *funcs = get_context_funcs( client_context ); - if (!(ctx = get_updated_context( teb, client_context ))) return FALSE; - if (ctx->tid && ctx->tid != tid) - { - RtlSetLastWin32Error( ERROR_BUSY ); - return FALSE; - } - - if (!funcs->p_wglMakeCurrent( hdc, client_context )) return FALSE; - if (prev) prev->tid = 0; - make_context_current( teb, funcs, hdc, hdc, client_context, ctx ); - } - else if (prev) - { - const struct opengl_funcs *funcs = teb->glTable; - if (!funcs->p_wglMakeCurrent( 0, NULL )) return FALSE; - prev->tid = 0; - teb->glTable = &null_opengl_funcs; - } - else if (!hdc) - { - RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); - return FALSE; - } - return TRUE; -} - static void free_context( struct context *ctx ) { free( ctx->wow64_version ); @@ -1428,7 +1393,7 @@ BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC else if (prev) { const struct opengl_funcs *funcs = teb->glTable; - if (!funcs->p_wglMakeCurrent( 0, NULL )) return FALSE; + if (!funcs->p_wglMakeContextCurrentARB( NULL, NULL, NULL )) return FALSE; prev->tid = 0; teb->glTable = &null_opengl_funcs; } diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index 226caf331d5..b52bafa9e04 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -51,14 +51,6 @@ struct wglGetPixelFormat_params int ret; }; -struct wglMakeCurrent_params -{ - TEB *teb; - HDC hDc; - HGLRC newContext; - BOOL ret; -}; - struct wglSetPixelFormat_params { TEB *teb; @@ -25874,7 +25866,6 @@ enum unix_funcs unix_wglCreateContext, unix_wglDeleteContext, unix_wglGetPixelFormat, - unix_wglMakeCurrent, unix_wglSetPixelFormat, unix_wglShareLists, unix_wglSwapBuffers, diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 6c3383d72da..7fd3db66fd5 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -407,20 +407,13 @@ BOOL WINAPI wglDeleteContext( HGLRC handle ) BOOL WINAPI wglMakeCurrent( HDC hdc, HGLRC handle ) { - TEB *teb = NtCurrentTeb(); - struct wglMakeCurrent_params args = { .teb = teb, .hDc = hdc }; - NTSTATUS status; - - TRACE( "hdc %p, newContext %p\n", hdc, handle ); - - if (!get_context_from_handle( handle, &args.newContext )) return FALSE; - if ((status = UNIX_CALL( wglMakeCurrent, &args ))) WARN( "wglMakeCurrent returned %#lx\n", status ); - if (status || !args.ret) return FALSE; - - teb->glCurrentRC = handle; - teb->glReserved1[0] = hdc; - teb->glReserved1[1] = hdc; - return TRUE; + TRACE( "hdc %p, handle %p\n", hdc, handle ); + if (!hdc && !handle && !NtCurrentTeb()->glCurrentRC) + { + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); + return FALSE; + } + return wglMakeContextCurrentARB( hdc, hdc, handle ); } BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC handle ) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 0815f4378e8..4ad0cbb4e4a 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1929,11 +1929,6 @@ static BOOL win32u_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC c return TRUE; } -static BOOL win32u_wglMakeCurrent( HDC hdc, HGLRC client_context ) -{ - return win32u_wglMakeContextCurrentARB( hdc, hdc, client_context ); -} - static void opengl_client_pbuffer_init( HPBUFFERARB client_pbuffer, struct pbuffer *pbuffer, const struct opengl_funcs *funcs ) { struct opengl_client_pbuffer *client = opengl_client_pbuffer_from_client( client_pbuffer ); @@ -2702,7 +2697,7 @@ static void display_funcs_init(void) display_funcs.p_wglDeleteContext = (void *)1; /* never called */ display_funcs.p_wglCopyContext = (void *)1; /* never called */ display_funcs.p_wglShareLists = (void *)1; /* never called */ - display_funcs.p_wglMakeCurrent = win32u_wglMakeCurrent; + display_funcs.p_wglMakeCurrent = (void *)1; /* never called */ display_funcs.p_wglSwapBuffers = win32u_wglSwapBuffers; display_funcs.p_context_flush = win32u_context_flush; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10763
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 32 -------------------------------- dlls/opengl32/unix_thunks.h | 1 - dlls/opengl32/unix_wgl.c | 11 ----------- dlls/opengl32/unixlib.h | 8 -------- dlls/opengl32/wgl.c | 16 ++-------------- 6 files changed, 3 insertions(+), 67 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 195fa2972c7..1c865158263 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -132,6 +132,7 @@ my %manual_win_functions = ( "glDebugEntry" => 1, "wglChoosePixelFormat" => 1, + "wglCreateContext" => 1, "wglCreateLayerContext" => 1, "wglDescribeLayerPlane" => 1, "wglDescribePixelFormat" => 1, @@ -166,7 +167,6 @@ my %manual_win_thunks = "glGetStringi" => 1, "glImportSyncEXT" => 1, "wglChoosePixelFormatARB" => 1, - "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglDeleteContext" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 35c7831fb1d..ad93a866a6d 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -31,15 +31,6 @@ static NTSTATUS wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; } -static NTSTATUS wgl_wglCreateContext( void *args ) -{ - struct wglCreateContext_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); - if (!funcs || !funcs->p_wglCreateContext) return STATUS_NOT_IMPLEMENTED; - params->ret = wrap_wglCreateContext( params->teb, params->hDc, params->ret ); - return STATUS_SUCCESS; -} - static NTSTATUS wgl_wglDeleteContext( void *args ) { struct wglDeleteContext_params *params = args; @@ -30570,7 +30561,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = process_detach, get_pixel_formats, wgl_wglCopyContext, - wgl_wglCreateContext, wgl_wglDeleteContext, wgl_wglGetPixelFormat, wgl_wglSetPixelFormat, @@ -33694,21 +33684,6 @@ static NTSTATUS wow64_wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; } -static NTSTATUS wow64_wgl_wglCreateContext( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDc; - PTR32 ret; - } *params = args; - TEB *teb = get_teb64( params->teb ); - const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hDc) ); - if (!funcs || !funcs->p_wglCreateContext) return STATUS_NOT_IMPLEMENTED; - params->ret = (UINT_PTR)wrap_wglCreateContext( teb, ULongToPtr(params->hDc), UlongToHandle( params->ret ) ); - return STATUS_SUCCESS; -} - static NTSTATUS wow64_wgl_wglDeleteContext( void *args ) { struct @@ -86979,7 +86954,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = wow64_process_detach, wow64_get_pixel_formats, wow64_wgl_wglCopyContext, - wow64_wgl_wglCreateContext, wow64_wgl_wglDeleteContext, wow64_wgl_wglGetPixelFormat, wow64_wgl_wglSetPixelFormat, @@ -90087,11 +90061,6 @@ static BOOL null_wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) WARN( "unsupported\n" ); return 0; } -static HGLRC null_wglCreateContext( HDC hDc ) -{ - WARN( "unsupported\n" ); - return 0; -} static BOOL null_wglDeleteContext( HGLRC oldContext ) { WARN( "unsupported\n" ); @@ -91474,7 +91443,6 @@ static void null_glViewport( GLint x, GLint y, GLsizei width, GLsizei height ) struct opengl_funcs null_opengl_funcs = { .p_wglCopyContext = null_wglCopyContext, - .p_wglCreateContext = null_wglCreateContext, .p_wglDeleteContext = null_wglDeleteContext, .p_wglGetPixelFormat = null_wglGetPixelFormat, .p_wglSetPixelFormat = null_wglSetPixelFormat, diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 700f857fa29..77c5b81218d 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -3,7 +3,6 @@ typedef ULONG PTR32; extern BOOL wrap_wglCopyContext( TEB *teb, HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ); -extern HGLRC wrap_wglCreateContext( TEB *teb, HDC hDc, HGLRC handle ); extern BOOL wrap_wglDeleteContext( TEB *teb, HGLRC oldContext ); extern BOOL wrap_wglShareLists( TEB *teb, HGLRC hrcSrvShare, HGLRC hrcSrvSource ); extern BOOL wrap_wglSwapBuffers( TEB *teb, HDC hdc ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 6db14e54418..ac81b99eeba 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1360,17 +1360,6 @@ HGLRC wrap_wglCreateContextAttribsARB( TEB *teb, HDC hdc, HGLRC client_shared, c return client_context; } -HGLRC wrap_wglCreateContext( TEB *teb, HDC hdc, HGLRC client_context ) -{ - static const int attribs[] = - { - WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, - 0, 0, - }; - - return wrap_wglCreateContextAttribsARB( teb, hdc, NULL, attribs, client_context ); -} - BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC client_context ) { DWORD tid = HandleToULong(teb->ClientId.UniqueThread); diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index b52bafa9e04..7b3bfca130e 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -30,13 +30,6 @@ struct wglCopyContext_params BOOL ret; }; -struct wglCreateContext_params -{ - TEB *teb; - HDC hDc; - HGLRC ret; -}; - struct wglDeleteContext_params { TEB *teb; @@ -25863,7 +25856,6 @@ enum unix_funcs unix_process_detach, unix_get_pixel_formats, unix_wglCopyContext, - unix_wglCreateContext, unix_wglDeleteContext, unix_wglGetPixelFormat, unix_wglSetPixelFormat, diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 7fd3db66fd5..eab3ddf3e44 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -334,21 +334,9 @@ void set_gl_error( GLenum error ) HGLRC WINAPI wglCreateContext( HDC hdc ) { - struct wglCreateContext_params args = { .teb = NtCurrentTeb(), .hDc = hdc }; - struct handle_entry *ptr; - NTSTATUS status; - + static const int attribs[] = { WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, 0, 0 }; TRACE( "hdc %p\n", hdc ); - - if (!(ptr = alloc_client_context())) return NULL; - args.ret = &ptr->context->obj; - - if ((status = UNIX_CALL( wglCreateContext, &args ))) WARN( "wglCreateContext returned %#lx\n", status ); - assert( args.ret == &ptr->context->obj || !args.ret ); - - if (!status && args.ret) return UlongToHandle( ptr->handle ); - free_client_context( ptr ); - return NULL; + return wglCreateContextAttribsARB( hdc, NULL, attribs ); } HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attribs ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10763
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/unix_wgl.c | 22 ++-------------------- dlls/opengl32/wgl.c | 24 +++++++++++++++++------- include/wine/opengl_driver.h | 1 + 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index ac81b99eeba..8e2fa4e05cc 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -129,7 +129,6 @@ struct context HGLRC client; /* client-side context handle */ HGLRC share; /* context to be shared with */ int *attribs; /* creation attributes */ - DWORD tid; /* thread that the context is current in */ UINT64 debug_callback; /* client pointer */ UINT64 debug_user; /* client pointer */ GLubyte *extensions; /* extension string */ @@ -432,10 +431,11 @@ static struct context *get_updated_context( TEB *teb, HGLRC client_context ); /* update context if it has been re-shared with another one */ static struct context *update_context( TEB *teb, HGLRC client_context, struct context *ctx ) { + struct opengl_client_context *client = opengl_client_context_from_client( client_context ); const struct opengl_funcs *funcs = get_context_funcs( client_context ); struct context *share; - if (ctx->tid) return ctx; /* currently in use */ + if (client->current_tid) return ctx; /* currently in use */ if (ctx->share == (HGLRC)-1) return ctx; /* not re-shared */ share = ctx->share ? get_updated_context( teb, ctx->share ) : NULL; @@ -1069,13 +1069,11 @@ static void make_context_current( TEB *teb, const struct opengl_funcs *funcs, HD HGLRC client_context, struct context *ctx ) { struct opengl_client_context *client = opengl_client_context_from_client( ctx->base.client_context ); - DWORD tid = HandleToULong(teb->ClientId.UniqueThread); const char *version, *rest = ""; size_t count = 0, i; static pthread_once_t once = PTHREAD_ONCE_INIT; - ctx->tid = tid; teb->glReserved1[0] = draw_hdc; teb->glReserved1[1] = read_hdc; teb->glTable = (void *)funcs; @@ -1154,13 +1152,6 @@ BOOL wrap_wglDeleteContext( TEB *teb, HGLRC client_context ) { const struct opengl_funcs *funcs = get_context_funcs( client_context ); struct context *ctx = context_from_client_context( client_context ); - - if (ctx->tid) - { - RtlSetLastWin32Error( ERROR_BUSY ); - return FALSE; - } - funcs->p_context_destroy( &ctx->base ); free_context( ctx ); return TRUE; @@ -1362,28 +1353,19 @@ HGLRC wrap_wglCreateContextAttribsARB( TEB *teb, HDC hdc, HGLRC client_shared, c BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC client_context ) { - DWORD tid = HandleToULong(teb->ClientId.UniqueThread); struct context *ctx, *prev = get_current_context( teb, NULL, NULL ); if (client_context) { const struct opengl_funcs *funcs = get_context_funcs( client_context ); if (!(ctx = get_updated_context( teb, client_context ))) return FALSE; - if (ctx->tid && ctx->tid != tid) - { - RtlSetLastWin32Error( ERROR_BUSY ); - return FALSE; - } - if (!funcs->p_wglMakeContextCurrentARB( draw_hdc, read_hdc, client_context )) return FALSE; - if (prev) prev->tid = 0; make_context_current( teb, funcs, draw_hdc, read_hdc, client_context, ctx ); } else if (prev) { const struct opengl_funcs *funcs = teb->glTable; if (!funcs->p_wglMakeContextCurrentARB( NULL, NULL, NULL )) return FALSE; - prev->tid = 0; teb->glTable = &null_opengl_funcs; } return TRUE; diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index eab3ddf3e44..27aae7cf6d8 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -379,16 +379,16 @@ BOOL WINAPI wglDeleteContext( HGLRC handle ) if (!ptr) return FALSE; args.oldContext = &ptr->context->obj; - if (handle && handle == teb->glCurrentRC) wglMakeCurrent( NULL, NULL ); + if (handle == teb->glCurrentRC) wglMakeCurrent( NULL, NULL ); + if (ptr->context->current_tid) + { + SetLastError( ERROR_BUSY ); + return FALSE; + } + if ((status = UNIX_CALL( wglDeleteContext, &args ))) WARN( "wglDeleteContext returned %#lx\n", status ); if (status || !args.ret) return FALSE; - if (handle == teb->glCurrentRC) - { - teb->glCurrentRC = 0; - teb->glReserved1[0] = 0; - teb->glReserved1[1] = 0; - } free_client_context( ptr ); return TRUE; } @@ -408,14 +408,24 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC handle ) { TEB *teb = NtCurrentTeb(); struct wglMakeContextCurrentARB_params args = { .teb = teb, .hDrawDC = draw_hdc, .hReadDC = read_hdc }; + struct opengl_client_context *context = NULL, *previous = opengl_client_context_from_handle( teb->glCurrentRC ); NTSTATUS status; TRACE( "draw_hdc %p, read_hdc %p, handle %p\n", draw_hdc, read_hdc, handle ); if (!get_context_from_handle( handle, &args.hglrc )) return FALSE; + if ((context = opengl_client_context_from_handle( handle )) && + context->current_tid && context->current_tid != GetCurrentThreadId()) + { + SetLastError( ERROR_BUSY ); + return FALSE; + } + if ((status = UNIX_CALL( wglMakeContextCurrentARB, &args ))) WARN( "wglMakeContextCurrentARB returned %#lx\n", status ); if (status || !args.ret) return FALSE; + if (context) context->current_tid = GetCurrentThreadId(); + if (previous) previous->current_tid = 0; teb->glCurrentRC = handle; teb->glReserved1[0] = draw_hdc; teb->glReserved1[1] = read_hdc; diff --git a/include/wine/opengl_driver.h b/include/wine/opengl_driver.h index 777a82c338a..edf65586fba 100644 --- a/include/wine/opengl_driver.h +++ b/include/wine/opengl_driver.h @@ -73,6 +73,7 @@ struct opengl_client_context struct HGLRC__ obj; /* client object header */ UINT64 unix_handle; UINT64 unix_funcs; + DWORD current_tid; /* thread that the context is current in */ GLenum last_error; int major_version; int minor_version; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10763
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/make_opengl | 30 ++++++++++++---- dlls/opengl32/private.h | 1 + dlls/opengl32/thunks.c | 50 ++++++++++++++++++++++++++ dlls/opengl32/thunks.h | 1 - dlls/opengl32/wgl.c | 76 +++------------------------------------ 5 files changed, 80 insertions(+), 78 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 1c865158263..3dec39cc0f0 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -158,11 +158,6 @@ my %manual_win_thunks = "glCreateSyncFromCLeventARB" => 1, "glDeleteSync" => 1, "glFenceSync" => 1, - "glGetBooleanv" => 1, - "glGetDoublev" => 1, - "glGetFloatv" => 1, - "glGetInteger64v" => 1, - "glGetIntegerv" => 1, "glGetString" => 1, "glGetStringi" => 1, "glImportSyncEXT" => 1, @@ -685,6 +680,7 @@ sub get_handle_function($) sub generate_win_thunk($$) { my ($name, $func) = @_; + my $get_integer = get_integer_call( $name, $func ); my $decl_args = get_func_args( $func ); my $func_ret = get_func_ret( $func ); my $params = ""; @@ -713,9 +709,11 @@ sub generate_win_thunk($$) $ret .= " = {$params }"; $ret .= ";\n"; $ret .= " NTSTATUS status;\n"; + $ret .= " int integer;\n" if $get_integer; $ret .= " " . get_func_trace( $name, $func, 1 ); $ret .= $checks; - $ret .= " if ((status = UNIX_CALL( $name, &args ))) WARN( \"$name returned %#lx\\n\", status );\n"; + $ret .= $get_integer ? " $get_integer\n else " : " "; + $ret .= "if ((status = UNIX_CALL( $name, &args ))) WARN( \"$name returned %#lx\\n\", status );\n"; $ret .= " return args.ret;\n" unless is_void_func($func); $ret .= "}\n"; @@ -1096,6 +1094,26 @@ sub add_extension($) } } +sub get_integer_call($) +{ + my ($name, $func) = @_; + my $params; + my $pname; + + foreach my $arg (@{$func->[1]}) + { + my $name = get_arg_name( $arg ); + my $type = get_arg_type( $arg ); + $pname = $name if $name =~ /^(pname|target|value)$/; + $params = $name; + } + + return 0 if !$pname; + + my $hook = "if (get_integer( $pname, &integer )) *$params = integer;"; + return $hook if $name =~ /^glGet(Boolean|Double|Float|Integer|Integer64)v/; +} + sub parse_registry($) { my $file = shift; diff --git a/dlls/opengl32/private.h b/dlls/opengl32/private.h index 3c3a218e31a..aa14924d1a8 100644 --- a/dlls/opengl32/private.h +++ b/dlls/opengl32/private.h @@ -44,5 +44,6 @@ extern BOOL get_context_from_handle( HGLRC handle, HGLRC *obj ); extern BOOL get_sync_from_handle( GLsync handle, GLsync *obj ); extern void set_gl_error( GLenum error ); extern struct registry_entry *get_function_entry( const char *name ); +extern BOOL get_integer( GLenum name, GLint *data ); #endif /* __WINE_OPENGL32_PRIVATE_H */ diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index 8e555b037b5..c62a6fdaa9f 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -841,6 +841,16 @@ void WINAPI glGenTextures( GLsizei n, GLuint *textures ) if ((status = UNIX_CALL( glGenTextures, &args ))) WARN( "glGenTextures returned %#lx\n", status ); } +void WINAPI glGetBooleanv( GLenum pname, GLboolean *data ) +{ + struct glGetBooleanv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; + NTSTATUS status; + int integer; + TRACE( "pname %d, data %p\n", pname, data ); + if (get_integer( pname, &integer )) *data = integer; + else if ((status = UNIX_CALL( glGetBooleanv, &args ))) WARN( "glGetBooleanv returned %#lx\n", status ); +} + void WINAPI glGetClipPlane( GLenum plane, GLdouble *equation ) { struct glGetClipPlane_params args = { .teb = NtCurrentTeb(), .plane = plane, .equation = equation }; @@ -849,6 +859,16 @@ void WINAPI glGetClipPlane( GLenum plane, GLdouble *equation ) if ((status = UNIX_CALL( glGetClipPlane, &args ))) WARN( "glGetClipPlane returned %#lx\n", status ); } +void WINAPI glGetDoublev( GLenum pname, GLdouble *data ) +{ + struct glGetDoublev_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; + NTSTATUS status; + int integer; + TRACE( "pname %d, data %p\n", pname, data ); + if (get_integer( pname, &integer )) *data = integer; + else if ((status = UNIX_CALL( glGetDoublev, &args ))) WARN( "glGetDoublev returned %#lx\n", status ); +} + GLenum WINAPI glGetError(void) { struct glGetError_params args = { .teb = NtCurrentTeb() }; @@ -858,6 +878,26 @@ GLenum WINAPI glGetError(void) return args.ret; } +void WINAPI glGetFloatv( GLenum pname, GLfloat *data ) +{ + struct glGetFloatv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; + NTSTATUS status; + int integer; + TRACE( "pname %d, data %p\n", pname, data ); + if (get_integer( pname, &integer )) *data = integer; + else if ((status = UNIX_CALL( glGetFloatv, &args ))) WARN( "glGetFloatv returned %#lx\n", status ); +} + +void WINAPI glGetIntegerv( GLenum pname, GLint *data ) +{ + struct glGetIntegerv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; + NTSTATUS status; + int integer; + TRACE( "pname %d, data %p\n", pname, data ); + if (get_integer( pname, &integer )) *data = integer; + else if ((status = UNIX_CALL( glGetIntegerv, &args ))) WARN( "glGetIntegerv returned %#lx\n", status ); +} + void WINAPI glGetLightfv( GLenum light, GLenum pname, GLfloat *params ) { struct glGetLightfv_params args = { .teb = NtCurrentTeb(), .light = light, .pname = pname, .params = params }; @@ -8603,6 +8643,16 @@ static void WINAPI glGetInteger64i_v( GLenum target, GLuint index, GLint64 *data if ((status = UNIX_CALL( glGetInteger64i_v, &args ))) WARN( "glGetInteger64i_v returned %#lx\n", status ); } +static void WINAPI glGetInteger64v( GLenum pname, GLint64 *data ) +{ + struct glGetInteger64v_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; + NTSTATUS status; + int integer; + TRACE( "pname %d, data %p\n", pname, data ); + if (get_integer( pname, &integer )) *data = integer; + else if ((status = UNIX_CALL( glGetInteger64v, &args ))) WARN( "glGetInteger64v returned %#lx\n", status ); +} + static void WINAPI glGetIntegerIndexedvEXT( GLenum target, GLuint index, GLint *data ) { struct glGetIntegerIndexedvEXT_params args = { .teb = NtCurrentTeb(), .target = target, .index = index, .data = data }; diff --git a/dlls/opengl32/thunks.h b/dlls/opengl32/thunks.h index c59ae7ff2c9..67d5691ed8c 100644 --- a/dlls/opengl32/thunks.h +++ b/dlls/opengl32/thunks.h @@ -3,7 +3,6 @@ extern GLsync WINAPI glCreateSyncFromCLeventARB( struct _cl_context *context, struct _cl_event *event, GLbitfield flags ); extern void WINAPI glDeleteSync( GLsync sync ); extern GLsync WINAPI glFenceSync( GLenum condition, GLbitfield flags ); -extern void WINAPI glGetInteger64v( GLenum pname, GLint64 *data ); extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ); extern GLsync WINAPI glImportSyncEXT( GLenum external_sync_type, GLintptr external_sync, GLbitfield flags ); extern BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 27aae7cf6d8..f4ca0e924b9 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -2039,8 +2039,12 @@ GLsync WINAPI glImportSyncEXT( GLenum external_sync_type, GLintptr external_sync return NULL; } -static BOOL get_integer( struct context *ctx, GLenum name, GLint *data ) +BOOL get_integer( GLenum name, GLint *data ) { + struct context *ctx; + + if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return FALSE; + switch (name) { case GL_MAJOR_VERSION: @@ -2119,76 +2123,6 @@ const GLubyte * WINAPI glGetString( GLenum name ) return args.ret; } -void WINAPI glGetBooleanv( GLenum pname, GLboolean *data ) -{ - struct glGetBooleanv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; - struct context *ctx; - NTSTATUS status; - GLint value; - - TRACE( "pname %d, data %p\n", pname, data ); - - if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return; - if (get_integer( ctx, pname, &value )) *data = value; - else if ((status = UNIX_CALL( glGetBooleanv, &args ))) WARN( "glGetBooleanv returned %#lx\n", status ); -} - -void WINAPI glGetDoublev( GLenum pname, GLdouble *data ) -{ - struct glGetDoublev_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; - struct context *ctx; - NTSTATUS status; - GLint value; - - TRACE( "pname %d, data %p\n", pname, data ); - - if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return; - if (get_integer( ctx, pname, &value )) *data = value; - else if ((status = UNIX_CALL( glGetDoublev, &args ))) WARN( "glGetDoublev returned %#lx\n", status ); -} - -void WINAPI glGetFloatv( GLenum pname, GLfloat *data ) -{ - struct glGetFloatv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; - struct context *ctx; - NTSTATUS status; - GLint value; - - TRACE( "pname %d, data %p\n", pname, data ); - - if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return; - if (get_integer( ctx, pname, &value )) *data = value; - else if ((status = UNIX_CALL( glGetFloatv, &args ))) WARN( "glGetFloatv returned %#lx\n", status ); -} - -void WINAPI glGetInteger64v( GLenum pname, GLint64 *data ) -{ - struct glGetInteger64v_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; - struct context *ctx; - NTSTATUS status; - GLint value; - - TRACE( "pname %d, data %p\n", pname, data ); - - if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return; - if (get_integer( ctx, pname, &value )) *data = value; - else if ((status = UNIX_CALL( glGetInteger64v, &args ))) WARN( "glGetInteger64v returned %#lx\n", status ); -} - -void WINAPI glGetIntegerv( GLenum pname, GLint *data ) -{ - struct glGetIntegerv_params args = { .teb = NtCurrentTeb(), .pname = pname, .data = data }; - struct context *ctx; - NTSTATUS status; - GLint value; - - TRACE( "pname %d, data %p\n", pname, data ); - - if (!(ctx = context_from_handle( NtCurrentTeb()->glCurrentRC ))) return; - if (get_integer( ctx, pname, &value )) *data = value; - else if ((status = UNIX_CALL( glGetIntegerv, &args ))) WARN( "glGetIntegerv returned %#lx\n", status ); -} - const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) { TRACE( "hdc %p\n", hdc ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10763
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)