mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[NTOS:EX]
- Use the calling thread instead of the passed-in thread to validate APC status in ExReleaseResourceForThreadLite. The latter can be user-set and might not be a KTHREAD at all. CORE-11315 #resolve svn path=/trunk/; revision=71398
This commit is contained in:
parent
6305b9d645
commit
412f0d26d0
|
@ -1817,7 +1817,7 @@ FASTCALL
|
|||
ExReleaseResourceLite(IN PERESOURCE Resource)
|
||||
{
|
||||
/* Just call the For-Thread function */
|
||||
ExReleaseResourceForThreadLite(Resource, (ERESOURCE_THREAD)PsGetCurrentThread());
|
||||
ExReleaseResourceForThreadLite(Resource, ExGetCurrentResourceThread());
|
||||
}
|
||||
|
||||
/*++
|
||||
|
@ -1855,7 +1855,7 @@ ExReleaseResourceForThreadLite(IN PERESOURCE Resource,
|
|||
|
||||
/* Sanity checks */
|
||||
ExpVerifyResource(Resource);
|
||||
ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread);
|
||||
ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, KeGetCurrentThread());
|
||||
|
||||
/* Check if it's exclusively owned */
|
||||
if (IsOwnedExclusive(Resource))
|
||||
|
|
|
@ -504,6 +504,10 @@ TestResourceWithOwner(
|
|||
InitThreadDataEx(&ThreadDataOwner, Res, ExAcquireResourceExclusiveLite, TestOwnerRes);
|
||||
|
||||
KeEnterCriticalRegion();
|
||||
ok_bool_true(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned");
|
||||
ExSetResourceOwnerPointer(Res, (PVOID)(ULONG_PTR)3);
|
||||
ExReleaseResourceForThreadLite(Res, 3);
|
||||
|
||||
ok_bool_true(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned");
|
||||
ExSetResourceOwnerPointer(Res, (PVOID)((ULONG_PTR)Res | 3));
|
||||
KeLeaveCriticalRegion();
|
||||
|
|
Loading…
Reference in a new issue