ReactOS 0.4.15-dev-8116-gf69e256
resrcsup.c File Reference
#include "cdprocs.h"
Include dependency graph for resrcsup.c:

Go to the source code of this file.

Macros

#define BugCheckFileId   (CDFS_BUG_CHECK_RESRCSUP)
 

Functions

 _Requires_lock_held_ (_Global_critical_region_)
 
BOOLEAN NTAPI CdNoopAcquire (_In_ PVOID Fcb, _In_ BOOLEAN Wait)
 
VOID NTAPI CdNoopRelease (_In_ PVOID Fcb)
 
 _Function_class_ (FAST_IO_RELEASE_FILE)
 

Macro Definition Documentation

◆ BugCheckFileId

#define BugCheckFileId   (CDFS_BUG_CHECK_RESRCSUP)

Definition at line 22 of file resrcsup.c.

Function Documentation

◆ _Function_class_()

_Function_class_ ( FAST_IO_RELEASE_FILE  )

Definition at line 366 of file resrcsup.c.

391{
392 PAGED_CODE();
393
394 //
395 // Release the resources.
396 //
397
398 ExReleaseResourceLite( &((PFCB) FileObject->FsContext)->FcbNonpaged->FcbResource );
399 ExReleaseResourceLite( ((PFCB) FileObject->FsContext)->Resource);
400}
#define PAGED_CODE()
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
Definition: cdstruc.h:902
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550

◆ _Requires_lock_held_()

_Requires_lock_held_ ( _Global_critical_region_  )

Definition at line 36 of file resrcsup.c.

77{
79 BOOLEAN Acquired;
80 PAGED_CODE();
81
82 //
83 // We look first at the IgnoreWait flag, next at the flag in the Irp
84 // Context to decide how to acquire this resource.
85 //
86
87 if (!IgnoreWait && FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT )) {
88
89 Wait = TRUE;
90 }
91
92 //
93 // Attempt to acquire the resource either shared or exclusively.
94 //
95
96 switch (Type) {
98
99#ifdef _MSC_VER
100#pragma prefast( suppress:28137, "prefast believes Wait should be a constant, but this is ok for CDFS" )
101#endif
103 break;
104
105 case AcquireShared:
106
108 break;
109
111
113 break;
114
115 default:
116 Acquired = FALSE;
117 NT_ASSERT( FALSE );
118 }
119
120 //
121 // If not acquired and the user didn't specifiy IgnoreWait then
122 // raise CANT_WAIT.
123 //
124
125 if (!Acquired && !IgnoreWait) {
126
127 CdRaiseStatus( IrpContext, STATUS_CANT_WAIT );
128 }
129
130 return Acquired;
131}
unsigned char BOOLEAN
Type
Definition: Type.h:7
@ AcquireShared
Definition: cdprocs.h:830
@ AcquireExclusive
Definition: cdprocs.h:829
@ AcquireSharedStarveExclusive
Definition: cdprocs.h:831
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE _In_ BOOLEAN IgnoreWait
Definition: cdprocs.h:844
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
#define CdRaiseStatus(IC, S)
Definition: cdprocs.h:1859
#define IRP_CONTEXT_FLAG_WAIT
Definition: cdstruc.h:1215
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1068
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
#define NT_ASSERT
Definition: rtlfuncs.h:3310

◆ CdNoopAcquire()

BOOLEAN NTAPI CdNoopAcquire ( _In_ PVOID  Fcb,
_In_ BOOLEAN  Wait 
)

Definition at line 218 of file resrcsup.c.

242{
243 PAGED_CODE();
244
247
248 return TRUE;
249}
_In_ PFCB Fcb
Definition: cdprocs.h:159
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

Referenced by CdInitializeGlobalData().

◆ CdNoopRelease()

VOID NTAPI CdNoopRelease ( _In_ PVOID  Fcb)

Definition at line 254 of file resrcsup.c.

275{
276 PAGED_CODE();
277
279}

Referenced by CdInitializeGlobalData().