ReactOS  0.4.14-dev-50-g13bb5e2
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 }
Definition: cdstruc.h:908
#define PAGED_CODE()
Definition: video.h:57
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817

◆ _Requires_lock_held_()

_Requires_lock_held_ ( _Global_critical_region_  )

Definition at line 36 of file resrcsup.c.

77 {
78  BOOLEAN Wait = FALSE;
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) {
97  case AcquireExclusive:
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 }
#define TRUE
Definition: types.h:120
#define IRP_CONTEXT_FLAG_WAIT
Definition: cdstruc.h:1221
Type
Definition: Type.h:6
#define PAGED_CODE()
Definition: video.h:57
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:848
unsigned char BOOLEAN
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1063
#define CdRaiseStatus(IC, S)
Definition: cdprocs.h:1869
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE _In_ BOOLEAN IgnoreWait
Definition: cdprocs.h:848
#define STATUS_CANT_WAIT
Definition: ntstatus.h:438
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ 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 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PAGED_CODE()
Definition: video.h:57
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by CdInitializeGlobalData().

◆ CdNoopRelease()

VOID NTAPI CdNoopRelease ( _In_ PVOID  Fcb)

Definition at line 254 of file resrcsup.c.

275 {
276  PAGED_CODE();
277 
279 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PAGED_CODE()
Definition: video.h:57
_In_ PFCB Fcb
Definition: cdprocs.h:151

Referenced by CdInitializeGlobalData().