ReactOS  0.4.15-dev-2700-g4b4ffa9
fxpkgfdo.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxPkgFdo.hpp
8 
9 Abstract:
10 
11  This module implements the pnp package for Fdo objects.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Both kernel and user mode
20 
21 Revision History:
22 
23 --*/
24 
25 #ifndef _FXPKGFDO_H_
26 #define _FXPKGFDO_H_
27 
30 
32 };
33 
34 class FxPkgFdo : public FxPkgPnp
35 {
36 public:
37  //
38  // Pnp Properties
39  //
41 
43 
44  //
45  // Default target to the attached device in the stack
46  //
48 
49  //
50  // A virtual target to yourself. This allows a cx to send
51  // the client. It may also be used by the client to send IO to itself.
52  //
54 
55 private:
56 
58 
59  //
60  // The following structure contains the function pointer table
61  // for the "events" this package can raise.
62  //
64 
66 
68 
70 
71  //
72  // Table of internal methods to handle PnP minor function codes.
73  //
75 
76  //
77  // Table of internal methods to handle power minor function codes.
78  //
80 
81  FxPkgFdo(
82  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
84  );
85 
86 public:
87 
89  static
90  NTSTATUS
91  _Create(
94  __deref_out FxPkgFdo ** PkgFdo
95  );
96 
98  NTSTATUS
101  );
102 
104  NTSTATUS
106  __in PWDF_CHILD_LIST_CONFIG ListConfig,
107  __in PWDF_OBJECT_ATTRIBUTES ListAttributes
108  );
109 
111  virtual
112  NTSTATUS
113  Initialize(
115  );
116 
118  NTSTATUS
120  VOID
121  );
122 
124  NTSTATUS
125  SetFilter(
127  );
128 
129  BOOLEAN
131  VOID
132  )
133  {
134  return m_Filter;
135  }
136 
137 private:
138 
140  virtual
141  NTSTATUS
143  __inout FxIrp* Irp
144  );
145 
147  virtual
148  NTSTATUS
150  __inout FxIrp *Irp
151  );
152 
154  static
155  NTSTATUS
156  _PnpPassDown(
157  __in FxPkgPnp* This,
158  __inout FxIrp* Irp
159  );
160 
162  static
163  NTSTATUS
166  __inout FxIrp *Irp
167  );
168 
170  static
171  NTSTATUS
174  __inout FxIrp *Irp
175  );
176 
178  NTSTATUS
180  __inout FxIrp *Irp
181  );
182 
184  static
185  NTSTATUS
188  __inout FxIrp *Irp
189  );
190 
192  static
193  NTSTATUS
196  __inout FxIrp *Irp
197  );
198 
200  NTSTATUS
202  __inout FxIrp *Irp
203  );
204 
205  VOID
207  __inout FxIrp *Irp
208  );
209 
210  VOID
212  __inout FxIrp *Irp
213  );
214 
216  static
217  NTSTATUS
220  __inout MdIrp Irp,
222  );
223 
225  static
226  NTSTATUS
229  __inout FxIrp *Irp
230  );
231 
233  NTSTATUS
235  __inout FxIrp *Irp
236  );
237 
239  static
240  NTSTATUS
243  __inout FxIrp *Irp
244  );
245 
247  static
248  NTSTATUS
251  __inout MdIrp Irp,
253  );
254 
255  VOID
257  __inout FxIrp *Irp
258  );
259 
260  virtual
261  BOOLEAN
263  VOID
264  );
265 
266  virtual
269  VOID
270  );
271 
272  virtual
275  VOID
276  );
277 
278  virtual
281  VOID
282  );
283 
284  virtual
287  VOID
288  );
289 
290  virtual
293  VOID
294  );
295 
296  static
298  NTSTATUS
301  __in FxIrp *Irp
302  );
303 
304  static
306  NTSTATUS
309  __in FxIrp *Irp
310  );
311 
312  static
314  NTSTATUS
317  __in FxIrp *Irp
318  );
319 
320  virtual
322  NTSTATUS
324  __out BOOLEAN* ParentOn
325  );
326 
327  virtual
330  VOID
331  );
332 
333  virtual
336  VOID
337  );
338 
339  virtual
340  VOID
342  VOID
343  );
344 
346  NTSTATUS
348  __in FxIrp *Irp
349  );
350 
352  NTSTATUS
354  __in FxIrp *Irp
355  );
356 
358  NTSTATUS
360  __in FxIrp *Irp
361  );
362 
364  NTSTATUS
366  __in FxIrp *Irp
367  );
368 
370  NTSTATUS
372  __in FxIrp *Irp
373  );
374 
376  NTSTATUS
378  __in FxIrp *Irp
379  );
380 
381  virtual
382  VOID
384  __in BOOLEAN IrpMustBePresent = TRUE
385  );
386 
388  virtual
389  NTSTATUS
391  __inout FxIrp* Irp
392  );
393 
394  virtual
395  VOID
397  __in BOOLEAN GracefulRemove
398  );
399 
400  virtual
401  VOID
403  VOID
404  );
405 
406  virtual
407  VOID
409  VOID
410  );
411 
413  virtual
414  NTSTATUS
416  VOID
417  );
418 
420  virtual
421  NTSTATUS
423  VOID
424  );
425 
426  virtual
429  VOID
430  )
431  {
432  return m_FdoPnpFunctionTable;
433  }
434 
435  virtual
438  VOID
439  )
440  {
442  }
443 
445  NTSTATUS
447  VOID
448  );
449 
450 public:
451 
452  static
455 
456 protected:
457  ~FxPkgFdo();
458 
459  static
462 
463  static
466 
468  static
469  NTSTATUS
470  STDCALL
473  __inout MdIrp Irp,
475  );
476 
478  static
479  NTSTATUS
480  STDCALL
483  __inout MdIrp Irp,
485  );
486 };
487 
488 #endif // _FXPKGFDO_H
virtual WDF_DEVICE_PNP_STATE PnpEventFdoRemovedOverload(VOID)
Definition: fxpkgfdo.cpp:1224
enum _WDF_DEVICE_PNP_STATE WDF_DEVICE_PNP_STATE
static const PFN_PNP_POWER_CALLBACK m_FdoPnpFunctionTable[IRP_MN_SURPRISE_REMOVAL+1]
Definition: fxpkgfdo.hpp:74
VOID HandleQueryCapabilitiesCompletion(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:613
virtual _Must_inspect_result_ NTSTATUS AskParentToRemoveAndReenumerate(VOID)
Definition: fxpkgfdokm.cpp:567
_Must_inspect_result_ NTSTATUS QueryForDsfInterface(VOID)
Definition: fxpkgfdokm.cpp:455
_Must_inspect_result_ NTSTATUS DispatchSystemQueryPower(__in FxIrp *Irp)
Definition: fdopower.cpp:414
virtual _Must_inspect_result_ NTSTATUS PowerCheckParentOverload(__out BOOLEAN *ParentOn)
Definition: fdopower.cpp:540
#define _Must_inspect_result_
Definition: no_sal2.h:62
virtual const PFN_PNP_POWER_CALLBACK * GetDispatchPower(VOID)
Definition: fxpkgfdo.hpp:437
static _Must_inspect_result_ NTSTATUS _PnpQueryCapabilitiesCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdokm.cpp:227
WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header
Definition: fxpkgfdo.hpp:29
virtual VOID PowerReleasePendingDeviceIrp(__in BOOLEAN IrpMustBePresent=TRUE)
Definition: fdopower.cpp:461
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
#define IRP_MN_QUERY_POWER
virtual _Must_inspect_result_ NTSTATUS ProcessRemoveDeviceOverload(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:1250
#define TRUE
Definition: types.h:120
static _Must_inspect_result_ NTSTATUS _PnpSurpriseRemoval(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:345
virtual WDF_DEVICE_PNP_STATE PnpEventPdoRemovedOverload(VOID)
Definition: fxpkgfdo.cpp:1167
static _Must_inspect_result_ NTSTATUS _PnpFilterResourceRequirements(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:748
static _Must_inspect_result_ NTSTATUS _PnpQueryDeviceRelations(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:372
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN m_Filter
Definition: fxpkgfdo.hpp:69
REENUMERATE_SELF_INTERFACE_STANDARD m_SurpriseRemoveAndReenumerateSelfInterface
Definition: fxpkgfdo.hpp:57
_Must_inspect_result_ NTSTATUS DispatchDeviceQueryPower(__in FxIrp *Irp)
Definition: fdopower.cpp:443
FxChildList * m_DefaultDeviceList
Definition: fxpkgfdo.hpp:40
Definition: fxirp.hpp:28
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize(VOID)
Definition: fxpkgfdo.cpp:1522
static _Must_inspect_result_ NTSTATUS _DispatchSetPower(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:90
static _Must_inspect_result_ NTSTATUS STDCALL _PnpFilteredStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdo.cpp:1437
static MdCompletionRoutineType _SystemPowerSxCompletion
Definition: fxpkgfdo.hpp:465
static _Must_inspect_result_ NTSTATUS _PnpQueryCapabilities(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:551
static _Must_inspect_result_ NTSTATUS _PowerPassDown(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:43
VOID HandleQueryPnpDeviceStateCompletion(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:763
_Must_inspect_result_ NTSTATUS DispatchDeviceSetPower(__in FxIrp *Irp)
Definition: fdopower.cpp:297
virtual const PFN_PNP_POWER_CALLBACK * GetDispatchPnp(VOID)
Definition: fxpkgfdo.hpp:428
static MdCompletionRoutineType RaiseDevicePowerCompletion
Definition: fxpkgfdo.hpp:454
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ NTSTATUS PnpFilterResourceRequirements(__inout FxIrp *Irp)
Definition: fxpkgfdokm.cpp:43
_In_ PIRP Irp
Definition: csq.h:116
#define __out
Definition: dbghelp.h:62
FxPnpDeviceRemoveAddedResources m_DeviceRemoveAddedResources
Definition: fxpkgfdo.hpp:67
unsigned char BOOLEAN
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS pGlobals, __in CfxDevice *Device, __deref_out FxPkgFdo **PkgFdo)
Definition: fxpkgfdo.cpp:195
IWudfIrp * MdIrp
Definition: mxum.h:103
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeOverload(VOID)
Definition: fdopower.cpp:495
FxPnpDeviceFilterResourceRequirements m_DeviceFilterRemoveResourceRequirements
Definition: fxpkgfdo.hpp:65
BOOLEAN IsFilter(VOID)
Definition: fxpkgfdo.hpp:130
_Must_inspect_result_ NTSTATUS DispatchSystemSetPower(__in FxIrp *Irp)
Definition: fdopower.cpp:234
virtual WDF_DEVICE_PNP_STATE PnpGetPostRemoveState(VOID)
Definition: fxpkgfdo.cpp:1197
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
static _Must_inspect_result_ NTSTATUS _PnpQueryInterface(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:490
_Must_inspect_result_ NTSTATUS PnpQueryCapabilities(__inout FxIrp *Irp)
Definition: fxpkgfdokm.cpp:244
virtual WDF_DEVICE_PNP_STATE PnpEventCheckForDevicePresenceOverload(VOID)
Definition: fxpkgfdo.cpp:1133
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
FxPnpDeviceFilterResourceRequirements m_DeviceFilterAddResourceRequirements
Definition: fxpkgfdo.hpp:63
virtual VOID PowerParentPowerDereference(VOID)
Definition: fdopower.cpp:566
#define STDCALL
Definition: wdf.h:45
_Must_inspect_result_ NTSTATUS PnpQueryDeviceRelations(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:399
FxIoTargetSelf * m_SelfTarget
Definition: fxpkgfdo.hpp:53
virtual VOID DeleteSymbolicLinkOverload(__in BOOLEAN GracefulRemove)
Definition: fxpkgfdo.cpp:1280
virtual VOID QueryForReenumerationInterface(VOID)
Definition: fxpkgfdo.cpp:1307
VOID HandleQueryCapabilities(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:572
_Must_inspect_result_ NTSTATUS SetFilter(__in BOOLEAN Value)
Definition: fxpkgfdo.cpp:892
FxPkgFdo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
Definition: fxpkgfdo.cpp:114
static MdCompletionRoutineType _SystemPowerS0Completion
Definition: fxpkgfdo.hpp:461
#define __inout
Definition: dbghelp.h:50
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ NTSTATUS LowerDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:398
PFX_DRIVER_GLOBALS pGlobals
virtual _Must_inspect_result_ NTSTATUS Initialize(__in PWDFDEVICE_INIT DeviceInit)
Definition: fxpkgfdokm.cpp:361
static _Must_inspect_result_ NTSTATUS _PnpQueryPnpDeviceState(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdokm.cpp:305
_Must_inspect_result_ NTSTATUS(* PFN_PNP_POWER_CALLBACK)(__inout FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgpnp.hpp:225
virtual _Must_inspect_result_ NTSTATUS QueryForPowerThread(VOID)
Definition: fxpkgfdo.cpp:1387
_Must_inspect_result_ NTSTATUS CreateDefaultDeviceList(__in PWDF_CHILD_LIST_CONFIG ListConfig, __in PWDF_OBJECT_ATTRIBUTES ListAttributes)
Definition: fxpkgfdo.cpp:816
static const PFN_PNP_POWER_CALLBACK m_FdoPowerFunctionTable[IRP_MN_QUERY_POWER+1]
Definition: fxpkgfdo.hpp:79
static _Must_inspect_result_ NTSTATUS _PnpPassDown(__in FxPkgPnp *This, __inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:307
virtual WDF_DEVICE_PNP_STATE PnpEventEjectHardwareOverload(VOID)
Definition: fxpkgfdo.cpp:1099
static _Must_inspect_result_ NTSTATUS _PnpQueryPnpDeviceStateCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdokm.cpp:288
FxChildList * m_StaticDeviceList
Definition: fxpkgfdo.hpp:42
virtual BOOLEAN PnpSendStartDeviceDownTheStackOverload(VOID)
Definition: fxpkgfdo.cpp:919
virtual _Must_inspect_result_ NTSTATUS FireAndForgetIrp(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:276
_Must_inspect_result_ NTSTATUS RaiseDevicePower(__in FxIrp *Irp)
Definition: fdopower.cpp:351
#define __deref_out
Definition: dbghelp.h:26
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
static _Must_inspect_result_ NTSTATUS _DispatchQueryPower(__inout FxPkgPnp *This, __in FxIrp *Irp)
Definition: fdopower.cpp:123
enum _WDF_DEVICE_POWER_STATE WDF_DEVICE_POWER_STATE
virtual _Must_inspect_result_ NTSTATUS SendIrpSynchronously(__inout FxIrp *Irp)
Definition: fxpkgfdo.cpp:248
virtual WDF_DEVICE_POWER_STATE PowerCheckDeviceTypeNPOverload(VOID)
Definition: fdopower.cpp:517
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Definition: wdfpdo.h:245
static _Must_inspect_result_ NTSTATUS STDCALL _PnpStartDeviceCompletionRoutine(__in MdDeviceObject DeviceObject, __inout MdIrp Irp, __inout PVOID Context)
Definition: fxpkgfdo.cpp:1460
#define __in
Definition: dbghelp.h:35
FxIoTarget * m_DefaultTarget
Definition: fxpkgfdo.hpp:47
_Must_inspect_result_ NTSTATUS RegisterCallbacks(__in PWDF_FDO_EVENT_CALLBACKS DispatchTable)
Definition: fxpkgfdo.cpp:796
virtual VOID ReleaseReenumerationInterface(VOID)
Definition: fxpkgfdo.cpp:1356