From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 3 +-- dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 821875a1b8a..3da5e0b5074 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, @@ -444,7 +443,7 @@ sub generate_unix_thunk($$$$) $ret .= " $ptype ret;\n"; } $ret .= " } *params = args;\n"; - if ($need_manual_thunk || get_wow64_arg_type( $func->[0] ) =~ /PTR32/) + if ($need_manual_thunk || $func->[0]->textContent() =~ /(GLsync|PROC|GLintptr|*)/) { $ret .= " FIXME( "params %p stub!\n", params );\n"; $ret .= " return STATUS_NOT_IMPLEMENTED;\n"; diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index a3ab4c887e9..8df8c9eb2f4 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 ); @@ -29918,6 +29918,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