Commit ec418e7f authored by Johannes Brandstätter's avatar Johannes Brandstätter Committed by Alexandre Julliard

ntdll: Check for NULL context in NtGetContextThread.

Crash Bandicoot N. Sane Trilogy calls NtGetContextThread with the context being set to NULL which leads to a crash. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45428Signed-off-by: 's avatarJohannes Brandstätter <jbrandst@2ds.eu> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 95c21f3f
......@@ -2160,9 +2160,13 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
{
NTSTATUS ret;
DWORD needed_flags = context->ContextFlags;
DWORD needed_flags;
BOOL self = (handle == GetCurrentThread());
if (!context) return STATUS_INVALID_PARAMETER;
needed_flags = context->ContextFlags;
/* debug registers require a server call */
if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) self = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment