ExReleaseResourceForThreadLite routine

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

Syntax

VOID ExReleaseResourceForThreadLite(
  _Inout_ PERESOURCE       Resource,
  _In_    ERESOURCE_THREAD ResourceThreadId
);

Parameters

  • Resource [in, out]
    A pointer to the resource to release.

  • ResourceThreadId [in]
    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

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

ExclusiveResourceAccess, WithinCriticalRegion, HwStorPortProhibitedDDIs, WithinCriticalRegion(storport)

See also

ExAcquireResourceExclusiveLite

ExAcquireResourceSharedLite

ExAcquireSharedStarveExclusive

ExAcquireSharedWaitForExclusive

ExGetCurrentResourceThread

ExInitializeResourceLite

ExReinitializeResourceLite

 

 

Send comments about this topic to Microsoft