ReactOS  0.4.15-dev-2700-g4b4ffa9
fxdeviceinit.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxDeviceInit.hpp
8 
9 Abstract:
10 
11 
12 Author:
13 
14 
15 Environment:
16 
17  kernel mode only
18 
19 Revision History:
20 
21 --*/
22 
23 #ifndef __FXDEVICEINIT_HPP__
24 #define __FXDEVICEINIT_HPP__
25 
30 };
31 
34 
36 
38 
40 
42 };
43 
44 struct SecurityInit {
46 
48 
50 };
51 
52 struct PnpPowerInit {
54 
56 
58 
60 
62 
64 };
65 
66 struct FdoInit {
68 
70 
72 
74 
76 };
77 
78 
79 
80 
81 #include "fxdeviceinitshared.hpp"
82 
83 struct ControlInit {
85  VOID
86  )
87  {
89  Flags = 0;
90  }
91 
93 
95 };
96 
97 //
98 // The typedef for a pointer to this structure is exposed in wdfdevice.h
99 //
100 struct WDFDEVICE_INIT : public FxStump {
101 public:
104  );
105 
106  ~WDFDEVICE_INIT();
107 
108  VOID
109  SetPdo(
111  );
112 
113  BOOLEAN
115  VOID
116  )
117  {
118  return InitType == FxDeviceInitTypeFdo;
119  }
120 
121  BOOLEAN
123  VOID
124  )
125  {
126  return InitType != FxDeviceInitTypeFdo;
127  }
128 
129  BOOLEAN
131  VOID
132  )
133  {
134  return InitType == FxDeviceInitTypePdo;
135  }
136 
137  BOOLEAN
139  VOID
140  )
141  {
142  return InitType != FxDeviceInitTypePdo;
143  }
144  BOOLEAN
146  VOID
147  )
148  {
150  }
151 
152  BOOLEAN
154  VOID
155  )
156  {
158  }
159 
160  BOOLEAN
162  VOID
163  )
164  {
165  if (DeviceName != NULL ||
167  return TRUE;
168  }
169  else {
170  return FALSE;
171  }
172  }
173 
174  BOOLEAN
176  VOID
177  );
178 
179  BOOLEAN
181  VOID
182  )
183  {
185  return TRUE;
186  }
187  else if (PnpPower.PowerPolicyOwner == WdfFalse) {
188  return FALSE;
189  }
190  else if (IsPdoInit()) {
191  //
192  // This is a PDO. If we are a raw PDO, we own pwr policy.
193  //
194  return Pdo.Raw;
195  }
196  else {
197  ASSERT(IsFdoInit());
198 
199  //
200  // This is an FDO. If we are not a filter, we own pwr policy.
201  //
202  return (Fdo.Filter == FALSE ? TRUE : FALSE);
203  }
204  }
205 
207  NTSTATUS
208  AssignName(
209  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
210  __in const UNICODE_STRING* Name
211  );
212 
213  static
219  );
220 
221  VOID
224  );
225 
226  VOID
227  AssignIoType(
229  );
230 
231 public:
233 
235 
237 
239 
241 
243 
245 
246  //
247  // If set, the Cx/Client intends to leverage Self IO Target
248  //
250 
252 
254 
256 
258 
260 
262 
264 
266 
268 
270 
272 
274 
279 
280  //
281  // Class extension's device init.
282  //
284 
285 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
286  //
287  // IoType preference for IOCTL
288  //
290 
291  //
292  // Direct I/O threshold
293  //
295 
296  //
297  // Weak reference to host side device stack
298  //
299  IWudfDeviceStack * DevStack;
300 
301  //
302  // Kernel redirector's side object name.
303  //
305 
306  //
307  // PnP devinode hw key handle
308  //
310 
311  //
312  // Registry sub-path name containing driver configuration information.
313  // The registry path name is relative to the "device key".
314  //
316 
317  //
318  // PDO Instance ID
319  //
321 
322  //
323  // This ID is used by Host to associated host device and its driver info.
324  //
326 #endif
327 
328 };
329 
330 #endif // __FXDEVICEINIT_HPP__
BOOLEAN IsNotPdoInit(VOID)
SecurityInit Security
#define _Must_inspect_result_
Definition: no_sal2.h:62
BOOLEAN IsControlDeviceInit(VOID)
FileObjectInit FileObject
BOOLEAN ShouldCreateSecure(VOID)
BOOLEAN DeviceClassSet
#define TRUE
Definition: types.h:120
WDF_FILEOBJECT_CONFIG Callbacks
uint16_t * PWSTR
Definition: typedefs.h:56
enum _WDF_TRI_STATE WDF_TRI_STATE
LONG NTSTATUS
Definition: precomp.h:26
EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION * PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION
Definition: wdfcontrol.h:62
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
WDF_FILEOBJECT_CLASS Class
WDF_OBJECT_ATTRIBUTES RequestAttributes
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
enum _WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
FxPowerPolicyStateCallback * PowerPolicyStateCallbacks
BOOLEAN HasName(VOID)
FxDevice * CreatedDevice
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
WDF_OBJECT_ATTRIBUTES ListConfigAttributes
DEVICE_TYPE DeviceType
#define FALSE
Definition: types.h:117
BOOLEAN RequiresSelfIoTarget
FxDeviceInitType InitType
enum _WDF_FILEOBJECT_CLASS WDF_FILEOBJECT_CLASS
unsigned char BOOLEAN
BOOLEAN IsPwrPolOwner(VOID)
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
FxString * Sddl
FxIrpPreprocessInfo * PreprocessInfo
ULONG DirectTransferThreshold
PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION ShutdownNotification
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ASSERT(a)
Definition: mode.c:44
static _Must_inspect_result_ PWDFDEVICE_INIT _AllocateControlDeviceInit(__in FxDriver *Driver, __in const UNICODE_STRING *SDDLString)
_In_ PWDFDEVICE_INIT _In_ PWDF_IO_TYPE_CONFIG IoTypeConfig
Definition: wdfdevice.h:4391
WDF_FDO_EVENT_CALLBACKS EventCallbacks
FxDriver * Driver
MdDeviceObject PhysicalDevice
BOOLEAN Filter
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
PFX_DRIVER_GLOBALS DriverGlobals
WDF_POWER_POLICY_EVENT_CALLBACKS PolicyEventCallbacks
unsigned char UCHAR
Definition: xmlstorage.h:181
WDF_TRI_STATE AutoForwardCleanupClose
VOID SetPdo(__in FxDevice *Parent)
BOOLEAN CreatedOnStack
WDFDEVICE_INIT(__in FxDriver *Driver)
VOID AssignIoType(_In_ PWDF_IO_TYPE_CONFIG IoTypeConfig)
WDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
FxString * DeviceName
Definition: typedefs.h:119
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure
ControlInit Control
LIST_ENTRY CxDeviceInitListHead
BOOLEAN IsNotFdoInit(VOID)
BOOLEAN IsFdoInit(VOID)
#define _In_
Definition: no_sal2.h:158
ControlInit(VOID)
PFN_WDF_IO_IN_CALLER_CONTEXT IoInCallerContextCallback
PWSTR ConfigRegistryPath
#define DEVICE_TYPE
Definition: guid.c:10
PnpPowerInit PnpPower
#define NULL
Definition: types.h:112
FxPowerStateCallback * PowerStateCallbacks
FxPnpStateCallback * PnpStateCallbacks
_Must_inspect_result_ _In_ WDFDRIVER _In_ CONST UNICODE_STRING * SDDLString
Definition: wdfcontrol.h:83
WDF_TRI_STATE PowerPolicyOwner
WDF_CHILD_LIST_CONFIG ListConfig
WDF_DEVICE_IO_TYPE DeviceControlIoType
BOOLEAN IsNotControlDeviceInit(VOID)
WDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ PWDFCXDEVICE_INIT CxDeviceInit
Definition: fxdynamics.h:1012
BOOLEAN PowerPageable
VOID AddCxDeviceInit(__in PWDFCXDEVICE_INIT CxDeviceInit)
unsigned int ULONG
Definition: retypes.h:1
_Must_inspect_result_ NTSTATUS AssignName(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Name)
IWudfDeviceStack * DevStack
#define __in
Definition: dbghelp.h:35
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
ULONG RemoveLockOptionFlags
EVT_WDF_IO_IN_CALLER_CONTEXT * PFN_WDF_IO_IN_CALLER_CONTEXT
Definition: wdfdevice.h:1728
BOOLEAN IsPdoInit(VOID)
WDF_DEVICE_IO_TYPE ReadWriteIoType
FxDeviceInitType