Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 330 of file debug.c.
{ PETHREAD Thread; NTSTATUS Status; KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PAGED_CODE(); /* Get the Thread Object */ Status = ObReferenceObjectByHandle(ThreadHandle, THREAD_GET_CONTEXT, PsThreadType, PreviousMode, (PVOID*)&Thread, NULL); if (!NT_SUCCESS(Status)) return Status; /* Make sure it's not a system thread */ if (Thread->SystemThread) { /* Fail */ Status = STATUS_INVALID_HANDLE; } else { /* Call the kernel API */ Status = PsGetContextThread(Thread, ThreadContext, PreviousMode); } /* Dereference it and return */ ObDereferenceObject(Thread); return Status; }