From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 680cf46652c..2b0e787324e 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -238,7 +238,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "glWaitSync" => 1, - "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglGetExtensionsStringARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index b320d6dd05f..cfd9401ff5a 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -32,7 +32,7 @@ static NTSTATUS wgl_wglCopyContext( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wgl_wglCreateContext( void *args ) +static NTSTATUS wgl_wglCreateContext( void *args ) { struct wglCreateContext_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); @@ -29927,6 +29927,23 @@ 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; + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglCreateContext( teb, ULongToPtr(params->hDc) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_wgl_wglDeleteContext( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index dc6174b6516..f83025c2830 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -32,8 +32,6 @@ extern int wrap_wglReleasePbufferDCARB( TEB *teb , HPBUFFERARB hPbuffer, HDC hDC extern BOOL wrap_wglReleaseTexImageARB( TEB *teb , HPBUFFERARB hPbuffer, int iBuffer ); extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const int *piAttribList );
-extern NTSTATUS wgl_wglCreateContext( void *args ); -extern NTSTATUS wow64_wgl_wglCreateContext( void *args ); extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); extern NTSTATUS gl_glGetString( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 5b730ea4def..5809d61ed0b 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1440,25 +1440,6 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) return wow64_str; }
-NTSTATUS wow64_wgl_wglCreateContext( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDc; - PTR32 ret; - } *params32 = args; - struct wglCreateContext_params params = - { - .teb = get_teb64(params32->teb), - .hDc = ULongToPtr(params32->hDc), - }; - NTSTATUS status; - if ((status = wgl_wglCreateContext( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) { struct