FltAcquireResourceShared routine

The FltAcquireResourceShared routine acquires the given resource for shared access by the calling thread.

Syntax


VOID FltAcquireResourceShared(
  _Inout_ PERESOURCE Resource
);

Parameters

Resource [in, out]

Pointer to an opaque ERESOURCE structure. This structure must be allocated by the caller from nonpaged pool and initialized by calling ExInitializeResourceLite or ExReinitializeResourceLite.

Return value

None

Remarks

This routine is available on Microsoft Windows XP SP2, Microsoft Windows Server 2003 SP1, and later.

The FltAcquireResourceShared routine acquires the given resource for shared access by the calling thread.

Whether or when the caller is given shared access to the given resource depends on the following:

  • If the resource is currently unowned, shared access is granted immediately to the current thread.

  • If the caller already has acquired the resource (for shared or exclusive access), the current thread is granted the same type of access recursively. Note that making this call does not convert a caller's exclusive ownership of a given resource to shared.

  • If the resource is currently owned as shared by another thread and no thread is waiting for exclusive access to the resource, shared access is granted to the caller immediately. The caller is put into a wait state if there is an exclusive waiter.

  • If the resource is currently owned as exclusive by another thread or if there is another thread waiting for exclusive access and the caller does not already have shared access to the resource, the current thread is put into a wait state until the resource can be acquired.

FltAcquireResourceShared is a wrapper for ExAcquireResourceSharedLite that disables normal kernel APC delivery.

Because FltAcquireResourceShared disables normal kernel APC delivery, it is not necessary to call KeEnterCriticalRegion or FsRtlEnterFileSystem before calling FltAcquireResourceShared.

To release the resource after it is acquired, call FltReleaseResource. Every successful call to FltAcquireResourceShared must be matched by a subsequent call to FltReleaseResource.

To acquire a resource for exclusive access, call FltAcquireResourceExclusive.

To delete a resource from the system's resource list, call ExDeleteResourceLite.

To initialize a resource for reuse, call ExReinitializeResourceLite.

For more information about ERESOURCE structures, see Introduction to ERESOURCE Routines in the Kernel Architecture Design Guide.

Requirements

Target platform

Universal

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

IRQL

<= APC_LEVEL

See also

ExAcquireResourceSharedLite
ExDeleteResourceLite
ExInitializeResourceLite
ExReinitializeResourceLite
FltAcquireResourceExclusive
FltReleaseResource
FsRtlEnterFileSystem
KeEnterCriticalRegion

 

 

Send comments about this topic to Microsoft

Show: