ReactOS 0.4.15-dev-7958-gcd0bb1a
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
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}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define CanFsdWait(I)
Definition: cdprocs.h:2001
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define Dbg
Definition: pnp.c:25
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
Definition: fatdata.c:204
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
Definition: fatdata.c:817
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
Definition: fatprocs.h:2417
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
Definition: strucsup.c:2301
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:158
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170

◆ FatPnpAdjustVpbRefCount()

VOID FatPnpAdjustVpbRefCount ( IN PVCB  Vcb,
IN ULONG  Delta 
)

Definition at line 318 of file pnp.c.

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

◆ 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}
#define FALSE
Definition: types.h:117
#define PKEVENT
Definition: env_spec_w32.h:70
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055