mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[NTOS:PS] Implement NtQueryInformationThread(ThreadBreakOnTermination)
Invoked by `RtlSetThreadIsCritical()` for returning the previous flag value, and fixes the following error: ``` (ntoskrnl/ps/query.c:3155) Not implemented: 18 ``` The implementation is "identical" to that of NtQueryInformationProcess() `ProcessBreakOnTermination`, with the necessary adaptations, of course.
This commit is contained in:
@@ -3112,6 +3112,41 @@ NtQueryInformationThread(IN HANDLE ThreadHandle,
|
|||||||
ObDereferenceObject(Thread);
|
ObDereferenceObject(Thread);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ThreadBreakOnTermination:
|
||||||
|
|
||||||
|
/* Set the return length */
|
||||||
|
Length = sizeof(ULONG);
|
||||||
|
|
||||||
|
if (ThreadInformationLength != Length)
|
||||||
|
{
|
||||||
|
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reference the thread */
|
||||||
|
Status = ObReferenceObjectByHandle(ThreadHandle,
|
||||||
|
Access,
|
||||||
|
PsThreadType,
|
||||||
|
PreviousMode,
|
||||||
|
(PVOID*)&Thread,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
break;
|
||||||
|
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
*(PULONG)ThreadInformation = Thread->BreakOnTermination;
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
Status = _SEH2_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
|
||||||
|
/* Dereference the thread */
|
||||||
|
ObDereferenceObject(Thread);
|
||||||
|
break;
|
||||||
|
|
||||||
case ThreadIsTerminated:
|
case ThreadIsTerminated:
|
||||||
|
|
||||||
/* Set the return length*/
|
/* Set the return length*/
|
||||||
|
Reference in New Issue
Block a user