ReactOS  0.4.14-dev-991-g696cdc6
pnp.c File Reference
#include "fatprocs.h"
Include dependency graph for pnp.c:

Go to the source code of this file.

Macros

#define BugCheckFileId   (FAT_BUG_CHECK_PNP)
 
#define Dbg   (DEBUG_TRACE_PNP)
 

Functions

 _Requires_lock_held_ (_Global_critical_region_)
 
VOID FatPnpAdjustVpbRefCount (IN PVCB Vcb, IN ULONG Delta)
 
NTSTATUS NTAPI FatPnpCompletionRoutine (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_reads_opt_(_Inexpressible_("varies")) PVOID Contxt)
 

Macro Definition Documentation

◆ BugCheckFileId

#define BugCheckFileId   (FAT_BUG_CHECK_PNP)

Definition at line 23 of file pnp.c.

◆ Dbg

#define Dbg   (DEBUG_TRACE_PNP)

Definition at line 25 of file pnp.c.

Function Documentation

◆ _Requires_lock_held_()

_Requires_lock_held_ ( _Global_critical_region_  )

Definition at line 27 of file pnp.c.

108 {
110  PIRP_CONTEXT IrpContext = NULL;
111 
113  BOOLEAN Wait;
114 
115  PAGED_CODE();
116 
117  DebugTrace(+1, Dbg, "FatFsdPnp\n", 0);
118 
120 
122 
123  _SEH2_TRY {
124 
125  //
126  // We expect there to never be a fileobject, in which case we will always
127  // wait. Since at the moment we don't have any concept of pending Pnp
128  // operations, this is a bit nitpicky.
129  //
130 
132 
133  Wait = TRUE;
134 
135  } else {
136 
137  Wait = CanFsdWait( Irp );
138  }
139 
140  IrpContext = FatCreateIrpContext( Irp, Wait );
141 
142  Status = FatCommonPnp( IrpContext, Irp );
143 
145 
146  //
147  // We had some trouble trying to perform the requested
148  // operation, so we'll abort the I/O request with
149  // the error status that we get back from the
150  // execption code
151  //
152 
153  Status = FatProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
154  } _SEH2_END;
155 
156  if (TopLevel) { IoSetTopLevelIrp( NULL ); }
157 
159 
160  //
161  // And return to our caller
162  //
163 
164  DebugTrace(-1, Dbg, "FatFsdPnp -> %08lx\n", Status);
165 
166  UNREFERENCED_PARAMETER( VolumeDeviceObject );
167 
168  return Status;
169 }
#define TRUE
Definition: types.h:120
#define FsRtlEnterFileSystem
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
Definition: fatdata.c:817
#define FsRtlExitFileSystem
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
Definition: fatprocs.h:2401
#define Dbg
Definition: pnp.c:25
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:11
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
Definition: strucsup.c:2300
#define CanFsdWait(I)
Definition: cdprocs.h:2011
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
Status
Definition: gdiplustypes.h:24
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_SEH2_END
Definition: create.c:4424
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
Definition: fatdata.c:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
IN BOOLEAN Wait
Definition: fatprocs.h:1529

◆ FatPnpAdjustVpbRefCount()

VOID FatPnpAdjustVpbRefCount ( IN PVCB  Vcb,
IN ULONG  Delta 
)

Definition at line 318 of file pnp.c.

322 {
323  KIRQL OldIrql;
324 
326  Vcb->Vpb->ReferenceCount += Delta;
328 }
VOID NTAPI IoAcquireVpbSpinLock(OUT PKIRQL Irql)
Definition: volume.c:1209
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define Vcb
Definition: cdprocs.h:1425
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
static ULONG Delta
Definition: xboxvideo.c:32
VOID NTAPI IoReleaseVpbSpinLock(IN KIRQL Irql)
Definition: volume.c:1220

◆ FatPnpCompletionRoutine()

NTSTATUS NTAPI FatPnpCompletionRoutine ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp,
_In_reads_opt_(_Inexpressible_("varies")) PVOID  Contxt 
)

Definition at line 885 of file pnp.c.

890 {
891  PKEVENT Event = (PKEVENT) Contxt;
892 
893  KeSetEvent( Event, 0, FALSE );
894 
896 
898  UNREFERENCED_PARAMETER( Contxt );
900 }
struct _KEVENT * PKEVENT
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560