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