mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +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
2 changed files with 6 additions and 2 deletions
|
@ -1817,7 +1817,7 @@ FASTCALL
|
||||||
ExReleaseResourceLite(IN PERESOURCE Resource)
|
ExReleaseResourceLite(IN PERESOURCE Resource)
|
||||||
{
|
{
|
||||||
/* Just call the For-Thread function */
|
/* Just call the For-Thread function */
|
||||||
ExReleaseResourceForThreadLite(Resource, (ERESOURCE_THREAD)PsGetCurrentThread());
|
ExReleaseResourceForThreadLite(Resource, ExGetCurrentResourceThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
|
@ -1855,7 +1855,7 @@ ExReleaseResourceForThreadLite(IN PERESOURCE Resource,
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ExpVerifyResource(Resource);
|
ExpVerifyResource(Resource);
|
||||||
ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread);
|
ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, KeGetCurrentThread());
|
||||||
|
|
||||||
/* Check if it's exclusively owned */
|
/* Check if it's exclusively owned */
|
||||||
if (IsOwnedExclusive(Resource))
|
if (IsOwnedExclusive(Resource))
|
||||||
|
|
|
@ -504,6 +504,10 @@ TestResourceWithOwner(
|
||||||
InitThreadDataEx(&ThreadDataOwner, Res, ExAcquireResourceExclusiveLite, TestOwnerRes);
|
InitThreadDataEx(&ThreadDataOwner, Res, ExAcquireResourceExclusiveLite, TestOwnerRes);
|
||||||
|
|
||||||
KeEnterCriticalRegion();
|
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");
|
ok_bool_true(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned");
|
||||||
ExSetResourceOwnerPointer(Res, (PVOID)((ULONG_PTR)Res | 3));
|
ExSetResourceOwnerPointer(Res, (PVOID)((ULONG_PTR)Res | 3));
|
||||||
KeLeaveCriticalRegion();
|
KeLeaveCriticalRegion();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue