[PATCH 0/1] MR10355: kernelbase: Check ntstatus for RtlActivateActivationContextEx inside CreateRemoteThreadEx to handle STATUS_INVALID_PARAMETER case
Windows implementation of the `RtlGetActiveActivationContext` can return `STATUS_INVALID_PARAMETER` which means that: `teb, actctx `or `cookie` are invalid arguments, windows implementation handles this case: {width=728 height=210} {width=730 height=347} I don't see the reason why Wine can't handle this case, that's why I implemented it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10355
From: Steve Sold <infirms@protonmail.com> --- dlls/kernelbase/thread.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c index 13040915817..d5c84a3eb7f 100644 --- a/dlls/kernelbase/thread.c +++ b/dlls/kernelbase/thread.c @@ -152,8 +152,13 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateRemoteThreadEx( HANDLE process, SECURITY_A if (actctx) { - ULONG_PTR cookie; - RtlActivateActivationContextEx( 0, teb, actctx, &cookie ); + ULONG_PTR cookie = 0; + if (!set_ntstatus( RtlActivateActivationContextEx( 0, teb, actctx, &cookie ))) + { + RtlReleaseActivationContext( actctx ); + return 0; + } + RtlReleaseActivationContext( actctx ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10355
participants (2)
-
Steve Sold -
Steve Sold (@inf)