ExReleaseResourceForThreadLite function (wdm.h)

The ExReleaseResourceForThreadLite routine releases the input resource of the indicated thread.

Syntax

void ExReleaseResourceForThreadLite(
  [in, out] PERESOURCE       Resource,
  [in]      ERESOURCE_THREAD ResourceThreadId
);

Parameters

[in, out] Resource

A pointer to the resource to release.

[in] ResourceThreadId

Identifies the thread that originally acquired the resource. If this is not the currently executing thread, the caller must have transferred ownership of the resource by calling the ExSetResourceOwnerPointerEx routine first on the thread that originally acquired the resource.

Return value

None

Remarks

If this is not the currently executing thread, the caller must have transferred ownership of the resource by calling the ExSetResourceOwnerPointerEx routine first on the thread that originally acquired the resource. This is to ensure that thread A does not get terminated or deleted before thread B has a chance to release the resource.

Unless the caller is running in a system thread, the caller must explicitly disable the delivery of normal kernel APCs before calling this routine. This requirement prevents threads from being suspended while they manipulate or hold a resource. The caller can disable normal kernel APC delivery by calling the KeEnterCriticalRegion routine. Delivery must remain disabled until the resource is released, at which point it can be reenabled by calling the KeLeaveCriticalRegion routine. For more information, see Disabling APCs.

This requirement does not apply to calls made to ExReleaseResourceForThreadLite from a system thread. A caller running in a system thread does not need to explicitly disable APCs before calling this routine.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL
DDI compliance rules ExclusiveResourceAccess(wdm), HwStorPortProhibitedDDIs(storport), WithinCriticalRegion(storport), WithinCriticalRegion(storport), WithinCriticalRegion(wdm)

See also

ExAcquireResourceExclusiveLite

ExAcquireResourceSharedLite

ExAcquireSharedStarveExclusive

ExAcquireSharedWaitForExclusive

ExGetCurrentResourceThread

ExInitializeResourceLite

ExReinitializeResourceLite