Export (0) Print
Expand All
Expand Minimize

ExSetResourceOwnerPointer routine

The ExSetResourceOwnerPointer routine sets the owner thread pointer for an executive resource.

Syntax


VOID ExSetResourceOwnerPointer(
  _Inout_  PERESOURCE Resource,
  _In_     PVOID OwnerPointer
);

Parameters

Resource [in, out]

A pointer to an executive resource owned by the current thread.

OwnerPointer [in]

A pointer to an owner thread pointer of type ERESOURCE_THREAD (for additional requirements, see the following Remarks section).

Return value

None

Remarks

ExSetResourceOwnerPointer, used in conjunction with ExReleaseResourceForThreadLite, provides a means for one thread (acting as an resource manager thread) to acquire and release resources for use by another thread (acting as a resource user thread).

After calling ExSetResourceOwnerPointer for a specific resource, the only other routine that can be called for that resource is ExReleaseResourceForThreadLite.

The resource manager thread acquires ownership of the resource and passes ownership to the user thread by calling ExSetResourceOwnerPointer. The caller must allocate the memory for the ERESOURCE_THREAD value pointed to by OwnerPointer in system memory, and this memory must remain allocated until ExReleaseResourceForThreadLite returns. The caller must also set the two low-order bits of the ERESOURCE_THREAD value pointed to by OwnerPointer to one — this encoding is used internally by the resource services to distinguish between owner and thread addresses.

When the user thread is done with the resource, the resource manager thread releases the user thread's ownership of the resource by calling ExReleaseResourceForThreadLite. The ResourceThreadId input parameter is set to the value of the OwnerPointer parameter used in the previous call to ExSetResourceOwnerPointer that gave the worker thread ownership of the resource.

Requirements

Version

Available starting with Windows 2000.

Header

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

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

HwStorPortProhibitedDDIs

See also

ExReleaseResourceForThreadLite

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft