ReactOS  0.4.15-dev-3017-g1d9542d
fxdeviceapikm.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxDeviceApiKm.cpp
8 
9 Abstract:
10 
11  This module exposes the "C" interface to the FxDevice object.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Kernel mode only
20 
21 Revision History:
22 
23 --*/
24 
25 #include "coreprivshared.hpp"
26 #include "fxiotarget.hpp"
27 
28 extern "C" {
29 // #include "FxDeviceApiKm.tmh"
30 }
31 
32 //
33 // extern "C" the entire file
34 //
35 extern "C" {
36 
37 //
38 // Verifier Functions
39 //
40 // Do not specify argument names
42 VOID,
45  _In_ FxDevice*,
47  );
48 
49 // Do not specify argument names
51 NTSTATUS,
53  _In_ FxDevice*,
54  _In_ MdIrp,
55  _In_ FxIoQueue*,
56  _In_ ULONG
57  );
58 
60 WDFDEVICE
61 STDCALL
62 WDFEXPORT(WdfWdmDeviceGetWdfDeviceHandle)(
63  __in
65  __in
67  )
68 {
70 
72 }
73 
76 STDCALL
77 WDFEXPORT(WdfDeviceWdmGetDeviceObject)(
78  __in
80  __in
81  WDFDEVICE Device
82  )
83 {
85 
87  Device,
89  (PVOID*) &pDevice);
90 
91  return pDevice->GetDeviceObject();
92 }
93 
96 STDCALL
97 WDFEXPORT(WdfDeviceWdmGetAttachedDevice)(
98  __in
100  __in
101  WDFDEVICE Device
102  )
103 {
105 
107  Device,
109  (PVOID*) &pDevice);
110 
111  return pDevice->GetAttachedDevice();
112 }
113 
114 
117 STDCALL
118 WDFEXPORT(WdfDeviceWdmGetPhysicalDevice)(
119  __in
121  __in
122  WDFDEVICE Device
123  )
124 {
126 
128  Device,
130  (PVOID*) &pDevice);
131 
132  return pDevice->GetPhysicalDevice();
133 }
134 
136 WDFFILEOBJECT
137 STDCALL
138 WDFEXPORT(WdfDeviceGetFileObject)(
139  __in
141  __in
142  WDFDEVICE Device,
143  __in
145  )
146 /*++
147 
148 Routine Description:
149 
150  This functions returns the WDFFILEOBJECT corresponding to the WDM fileobject.
151 
152 Arguments:
153 
154  Device - Handle to the device to which the WDM fileobject is related to.
155 
156  FileObject - WDM FILE_OBJECT structure.
157 
158 Return Value:
159 
160 --*/
161 
162 {
167 
169 
170 
171 
172 
173 
174 
175  pFxFO = NULL;
176 
177  //
178  // Validate the Device object handle, and get its FxDevice*
179  //
181  Device,
183  (PVOID*)&pDevice);
184 
185  //
186  // Call the static GetFileObjectFromWdm function. This will return an error if the
187  // WDM fileObject is NULL and the device is not exclusive or the device is
188  // configured to have a WDFFILEOBJECT for every open handle.
189  //
191  pDevice,
193  FileObject,
194  &pFxFO
195  );
196 
200  "FxFileObject::_GetFileObjectFromWdm returned an error %!STATUS!",
201  status);
202  return NULL;
203  }
204 
205  //
206  // pFxFO can be NULL if the device is configured with FileObjectClass WdfFileObjectNotRequired.
207  //
208  return pFxFO != NULL ? pFxFO->GetHandle() : NULL;
209 }
210 
213 NTSTATUS
214 STDCALL
215 WDFEXPORT(WdfDeviceWdmDispatchPreprocessedIrp)(
216  __in
218  __in
219  WDFDEVICE Device,
220  __in
221  MdIrp Irp
222  )
223 {
224  FxDevice *device;
226 
228  Device,
230  (PVOID*) &device,
231  &fxDriverGlobals);
232 
234 
235  //
236  // Verifier checks.
237  // This API can only be called by the client driver, Cx must call
238  // WdfDeviceWdmDispatchIrp from its preprocess callback.
239  // Also, Cx must register for a Preprocessor routine using
240  // WdfCxDeviceInitAssignWdmIrpPreprocessCallback.
241  //
243  if (device->IsCxInIoPath()) {
245 
246  if (IsListEmpty(&device->m_PreprocessInfoListHead) ||
247  device->IsCxDriverInIoPath(driver)) {
248 
251  "This API can only be called by client driver from its "
252  "pre-process IRP callback, STATUS_INVALID_DEVICE_REQUEST");
254  }
255  }
256  }
257 
258  //
259  // OK, ready to dispatch IRP.
260  //
261  return device->DispatchPreprocessedIrp(
262  Irp,
263  device->m_PreprocessInfoListHead.Flink->Flink);
264 }
265 
266 VOID
268  _In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
272  )
273 {
274  UNREFERENCED_PARAMETER(FxDriverGlobals);
275  FxDriver* driver;
279 
281 
285  &device->m_PreprocessInfoListHead ? TRUE : FALSE;
286  //
287  // Driver should be a cx.
288  //
289  if (device->IsCxDriverInIoPath(driver) == FALSE) {
292  device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGIO,
293  "This API can only be called by wdf extension driver "
294  "from its pre-process IRP callback, %!STATUS!",
295  status);
296  FxVerifierDbgBreakPoint(device->GetDriverGlobals());
297  }
298 
299  //
300  // Validate DispatchContext.
301  //
302 
303  for (next = device->m_PreprocessInfoListHead.Flink;
304  next != &device->m_PreprocessInfoListHead;
305  next = next->Flink) {
306  if ((PLIST_ENTRY)DispatchContext == next) {
307  ctxValid = TRUE;
308  break;
309  }
310  }
311 
312  if (FALSE == ctxValid) {
315  device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGIO,
316  "DispatchContext 0x%p is invalid, %!STATUS!",
318  FxVerifierDbgBreakPoint(device->GetDriverGlobals());
319  }
320 }
321 
324 NTSTATUS
325 STDCALL
326 WDFEXPORT(WdfDeviceWdmDispatchIrp)(
327  __in
329  __in
330  WDFDEVICE Device,
331  __in
332  MdIrp Irp,
333  __in
335  )
336 
337 /*++
338 
339 Routine Description:
340 
341  Client driver calls this API from its dispatch callback when it decides to hand the IRP
342  back to framework.
343 
344  Cx calls this API from (a) its pre-process callback or (b) its dispatch callback when
345  it decides to hand the IRP back to the framework.
346 
347 Arguments:
348  Device - WDF Device handle.
349 
350  IRP - WDM request.
351 
352  DispatchContext - WDF's context (input arg to callback).
353 
354 Returns:
355  IRP's status.
356 
357 --*/
358 
359 {
360  FxDevice *device;
362 
364  Device,
366  (PVOID*) &device);
367 
368  FxPointerNotNull(device->GetDriverGlobals(), Irp);
369  FxPointerNotNull(device->GetDriverGlobals(), DispatchContext);
370 
372  //
373  // Called from a dispach irp callback.
374  //
377 
378  //
379  // DispatchContext is validated by DispatchStep1.
380  //
381  status = device->m_PkgIo->DispatchStep1(Irp, DispatchContext);
382  }
383  else {
384  //
385  // Called from a pre-process irp callback.
386  //
387 
388  //
389  // Verifier checks.
390  //
391  VerifyWdfDeviceWdmDispatchIrp(device->GetDriverGlobals(),
393  device,
395 
396  status = device->DispatchPreprocessedIrp(Irp, DispatchContext);
397  }
398 
399  return status;
400 }
401 
404 NTSTATUS
405 STDCALL
406 WDFEXPORT(WdfDeviceWdmDispatchIrpToIoQueue)(
407  __in
409  __in
410  WDFDEVICE Device,
411  __in
412  MdIrp Irp,
413  __in
414  WDFQUEUE Queue,
415  __in
416  ULONG Flags
417  )
418 {
419  FxIoQueue *queue;
425 
428 
430  Device,
432  (PVOID*) &device);
433 
434  fxDriverGlobals = device->GetDriverGlobals();
436 
438  Queue,
440  (PVOID*)&queue);
441 
443 
444  //
445  // If the caller is a preprocess routine, the contract for this DDI is just like IoCallDriver.
446  // The caller sets up their stack location and then the DDI advances to the next stack
447  // location. This means that the caller either has to call IoSkipCurrentIrpStackLocation
448  // or IoCopyCurrentIrpStackLocationToNext before calling this DDI.
449  //
452  }
453 
454  //
455  // Verifier checks.
456  //
458  device,
459  Irp,
460  queue,
461  Flags);
462  if(!NT_SUCCESS(status)) {
463  Irp->IoStatus.Status = status;
464  Irp->IoStatus.Information = 0;
466 
467  return status;
468  }
469 
470  //
471  // Adjust stack if IRP needs to be forwarded to parent device.
472  //
473  if (device->m_ParentDevice == queue->GetDevice()) {
476 
477  //
478  // From now on use new device.
479  //
480  device = device->m_ParentDevice;
481 
482  //
483  // Save a pointer to the device object for this request so that it can
484  // be used later in completion.
485  //
487  stack->DeviceObject = device->GetDeviceObject();
488  }
489 
490  //
491  // Get in-context caller callback if required.
492  //
494  ioInCallerCtx = device->m_PkgIo->GetIoInCallerContextCallback(
495  queue->GetCxDeviceInfo());
496  }
497 
498  //
499  // DispatchStep2 will convert the IRP into a WDFREQUEST, queue it and if
500  // possible dispatch the request to the driver.
501  //
502  return device->m_PkgIo->DispatchStep2(Irp, ioInCallerCtx, queue);
503 }
504 
507 NTSTATUS
508 STDCALL
509 WDFEXPORT(WdfDeviceAddDependentUsageDeviceObject)(
510  __in
512  __in
513  WDFDEVICE Device,
514  __in
516  )
517 {
519  FxDevice *pDevice;
520 
522  Device,
524  (PVOID *) &pDevice,
526 
528 
530 }
531 
533 VOID
534 STDCALL
535 WDFEXPORT(WdfDeviceRemoveDependentUsageDeviceObject)(
536  __in
538  __in
539  WDFDEVICE Device,
540  __in
542  )
543 {
545  FxDevice *pDevice;
546 
548  Device,
550  (PVOID *) &pDevice,
552 
554 
556 }
557 
560 NTSTATUS
561 STDCALL
562 WDFEXPORT(WdfDeviceAssignMofResourceName)(
563  __in
565  __in
566  WDFDEVICE Device,
567  __in
569  )
570 {
572  FxDevice *pDevice;
574 
576  Device,
578  (PVOID *) &pDevice,
580 
582 
584  if (!NT_SUCCESS(status)) {
585  return status;
586  }
587 
589  if (!NT_SUCCESS(status)) {
590  return status;
591  }
592 
595 
598  "WDFDEVICE %p MofResourceName already assigned, %!STATUS!",
599  Device, status);
600 
601  return status;
602  }
603 
607 
608  if (!NT_SUCCESS(status)) {
611  "WDFDEVICE %p couldn't creat duplicate buffer, %!STATUS!",
612  Device, status);
613  }
614 
615  return status;
616 }
617 
619 VOID
620 STDCALL
621 WDFEXPORT(WdfDeviceSetSpecialFileSupport)(
622  __in
624  __in
625  WDFDEVICE Device,
626  __in
628  __in
630  )
631 {
632  FxDevice* pDevice;
634 
636  Device,
638  (PVOID *) &pDevice,
640 
644  "WDFDEVICE 0x%p FileType %d specified is not in valid range",
645  Device, FileType);
647  return;
648  }
649 
651  Device,
653  (PVOID*) &pDevice);
654 
656 }
657 
660 NTSTATUS
661 STDCALL
662 WDFEXPORT(WdfDeviceIndicateWakeStatus)(
663  __in
665  __in
666  WDFDEVICE Device,
667  __in
669  )
670 {
672  FxDevice *pDevice;
674 
676  Device,
678  (PVOID *) &pDevice,
680 
681  if (Device == NULL ||
684  "NULL WDFDEVICE handle %p or invalid %!STATUS!",
687  }
688 
692  }
693  else {
694  //
695  // There was no request to complete
696  //
698  "WDFDEVICE 0x%p No request to complete"
699  " STATUS_INVALID_DEVICE_REQUEST",
700  Device);
701 
703  }
704  }
705  else {
706  //
707  // We cannot complete what we do not own
708  //
710  "WDFDEVICE 0x%p Not the waitwake owner"
711  " STATUS_INVALID_DEVICE_STATE",
712  Device);
713 
715  }
716 
717  return status;
718 }
719 
721 VOID
722 STDCALL
723 WDFEXPORT(WdfDeviceSetBusInformationForChildren)(
724  __in
726  __in
727  WDFDEVICE Device,
728  __in
730  )
731 {
732  FxDevice* pDevice;
733 
735  Device,
737  (PVOID*) &pDevice);
738 
740 
742 }
743 
746 NTSTATUS
747 STDCALL
748 WDFEXPORT(WdfDeviceAddRemovalRelationsPhysicalDevice)(
749  __in
751  __in
752  WDFDEVICE Device,
753  __in
755  )
756 /*++
757 
758 Routine Description:
759  Registers a PDO from another non descendant (not verifiable though) pnp
760  stack to be reported as also requiring removal when this PDO is removed.
761 
762  The PDO could be another device enumerated by this driver.
763 
764 Arguments:
765  Device - this driver's PDO
766 
767  PhysicalDevice - PDO for another stack
768 
769 Return Value:
770  NTSTATUS
771 
772  --*/
773 {
774  FxDevice* pDevice;
775 
777  Device,
779  (PVOID*) &pDevice);
780 
782 
784 }
785 
787 VOID
788 STDCALL
789 WDFEXPORT(WdfDeviceRemoveRemovalRelationsPhysicalDevice)(
790  __in
792  __in
793  WDFDEVICE Device,
794  __in
796  )
797 /*++
798 
799 Routine Description:
800  Deregisters a PDO from another non descendant (not verifiable though) pnp
801  stack to not be reported as also requiring removal when this PDO is removed.
802 
803  The PDO could be another device enumerated by this driver.
804 
805 Arguments:
806  Device - this driver's PDO
807 
808  PhysicalDevice - PDO for another stack
809 
810 Return Value:
811  None
812 
813  --*/
814 {
815  FxDevice* pDevice;
816 
818  Device,
820  (PVOID*) &pDevice);
821 
823 
825 }
826 
828 VOID
829 STDCALL
830 WDFEXPORT(WdfDeviceClearRemovalRelationsDevices)(
831  __in
833  __in
834  WDFDEVICE Device
835  )
836 /*++
837 
838 Routine Description:
839  Deregisters all PDOs to not be reported as also requiring removal when this
840  PDO is removed.
841 
842 Arguments:
843  Device - this driver's PDO
844 
845 Return Value:
846  None
847 
848  --*/
849 {
850  FxDevice* pDevice;
851 
853  Device,
855  (PVOID*) &pDevice);
856 
858 }
859 
862 NTSTATUS
863 STDCALL
864 WDFEXPORT(WdfDeviceWdmAssignPowerFrameworkSettings)(
865  __in
867  __in
868  WDFDEVICE Device,
869  __in
871  )
872 /*++
873 
874 Routine Description:
875  The DDI is invoked by KMDF client drivers for single-component devices to
876  specify their power framework settings to KMDF. KMDF uses these settings on
877  Win8+ when registering with the power framework.
878 
879  On Win7 and older operating systems the power framework is not available, so
880  KMDF does nothing.
881 
882 Arguments:
883 
884  Device - Handle to the framework device object for which power framework
885  settings are being specified.
886 
887  PowerFrameworkSettings - Pointer to a WDF_POWER_FRAMEWORK_SETTINGS structure
888  that contains the client driver's power framework settings.
889 
890 Return Value:
891  An NTSTATUS value that denotes success or failure of the DDI
892 
893 --*/
894 {
897  FxDevice *pDevice;
898 
899  //
900  // Validate the Device object handle and get its FxDevice. Also get the
901  // driver globals pointer.
902  //
904  Device,
906  (PVOID *) &pDevice,
908 
910 
911  //
912  // Only power policy owners should call this DDI
913  //
918  "WDFDEVICE 0x%p is not the power policy owner, so the caller cannot"
919  " assign power framework settings %!STATUS!", Device, status);
921  return status;
922  }
923 
924  //
925  // Validate the Settings parameter
926  //
931  "WDFDEVICE 0x%p Expected PowerFrameworkSettings size %d, actual %d,"
932  " %!STATUS!",
933  Device,
936  status);
938  return status;
939  }
940 
941  //
942  // If settings for component 0 are specified, make sure it contains at least
943  // one F-state.
944  //
945  if (NULL != PowerFrameworkSettings->Component) {
946 
947  if (0 == PowerFrameworkSettings->Component->IdleStateCount) {
951  "WDFDEVICE 0x%p Component settings are specified but "
952  "IdleStateCount is 0. %!STATUS!", Device, status);
954  return status;
955  }
956 
957  if (NULL == PowerFrameworkSettings->Component->IdleStates) {
961  "WDFDEVICE 0x%p Component settings are specified but IdleStates"
962  " is NULL. %!STATUS!", Device, status);
964  return status;
965  }
966  }
967 
968  //
969  // Assign the driver's settings
970  //
973 
974  return status;
975 }
976 
977 } // extern "C"
struct _LIST_ENTRY * PLIST_ENTRY
__in WDFDEVICE __in MdFileObject FileObject
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &device, &fxDriverGlobals)
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT _Inout_ PIRP _In_ WDFCONTEXT DispatchContext
Definition: wdfdevice.h:1697
VOID RemoveUsageDevice(__in MdDeviceObject DependentDevice)
Definition: fxpkgpnp.cpp:4742
_Must_inspect_result_ NTSTATUS AddUsageDevice(__in MdDeviceObject DependentDevice)
Definition: fxpkgpnp.cpp:4685
__in WDFDEVICE __in WDF_SPECIAL_FILE_TYPE FileType
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
FxDevice * device
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
VOID FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrp(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_DRIVER_GLOBALS DriverGlobals, _In_ FxDevice *device, _In_ WDFCONTEXT DispatchContext)
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
__in WDFDEVICE __in PPNP_BUS_INFORMATION BusInformation
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2221
if(!NT_SUCCESS(status))
FxDevice * pDevice
#define FX_VF_FUNCTION(fnName)
Definition: fxmacros.hpp:47
LONG NTSTATUS
Definition: precomp.h:26
static FxDevice * GetFxDevice(__in MdDeviceObject DeviceObject)
Definition: fxdeviceum.cpp:60
_Must_inspect_result_ __in WDFDEVICE __in PDEVICE_OBJECT DependentDevice
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
DriverGlobals
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
Definition: wdfdevice.h:4332
FxFileObject * pFxFO
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
_Must_inspect_result_ __in WDFDEVICE __in MdIrp Irp
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE __in ULONG Flags
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2868
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFCONTEXT DispatchContext
_Must_inspect_result_ _In_ WDFDEVICE _In_ NTSTATUS WaitWakeStatus
Definition: wdfdevice.h:3942
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
Definition: wdfdevice.h:2739
#define FALSE
Definition: types.h:117
_Must_inspect_result_ __in WDFDEVICE __in PDEVICE_OBJECT PhysicalDevice
_In_ PIRP Irp
Definition: csq.h:116
UNICODE_STRING m_MofResourceName
Definition: fxdevice.hpp:585
Definition: devices.h:37
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
VOID SetSpecialFileSupport(__in WDF_SPECIAL_FILE_TYPE FileType, __in BOOLEAN Supported)
Definition: fxpkgpnp.cpp:1307
NTSTATUS status
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE Queue
FxDriver * Driver
Definition: fxglobals.h:374
FX_DECLARE_VF_FUNCTION_P3(VOID, VerifyWdfDeviceWdmDispatchIrp, _In_ PWDF_DRIVER_GLOBALS, _In_ FxDevice *, _In_ WDFCONTEXT)
__inline WDF_FILEOBJECT_CLASS GetFileObjectClass(VOID)
Definition: fxdevice.hpp:1123
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
_Must_inspect_result_ _In_ WDFDEVICE _In_ PDEVICE_OBJECT DependentDevice
Definition: wdfdevice.h:2260
Definition: _queue.h:59
unsigned char BOOLEAN
MdDeviceObject __inline GetAttachedDevice(VOID)
Definition: fxdevice.hpp:210
FxIoInCallerContext * ioInCallerCtx
#define _In_
Definition: ms_sal.h:308
#define IoCompleteRequest
Definition: irp.c:1240
IWudfIrp * MdIrp
Definition: mxum.h:103
Definition: _stack.h:47
BOOLEAN ctxValid
Definition: fxpkgio.cpp:129
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define TRACINGDEVICE
Definition: dbgtrace.h:58
PVOID WDFCONTEXT
Definition: wdftypes.h:94
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
MdDeviceObject __inline GetPhysicalDevice(VOID)
Definition: fxdevice.hpp:228
#define STDCALL
Definition: wdf.h:45
PFX_DRIVER_GLOBALS fxDriverGlobals
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
_Must_inspect_result_ BOOLEAN IsVerificationEnabled(__in ULONG Major, __in ULONG Minor, __in FxVerifierDownlevelOption DownLevel)
Definition: fxglobals.h:286
_Must_inspect_result_ NTSTATUS AddRemovalDevice(__in MdDeviceObject DependentDevice)
Definition: fxpkgpnp.cpp:4753
static _Must_inspect_result_ NTSTATUS _GetFileObjectFromWdm(__in FxDevice *pDevice, __in WDF_FILEOBJECT_CLASS FileObjectClass, __in_opt MdFileObject pWdmFileObject, __deref_out_opt FxFileObject **ppFxFileObject)
_Must_inspect_result_ __in WDFDEVICE __in PCUNICODE_STRING MofResourceName
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
unsigned char UCHAR
Definition: xmlstorage.h:181
_Must_inspect_result_ NTSTATUS FxDuplicateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source, __out PUNICODE_STRING Destination)
Definition: stringutil.cpp:180
BOOLEAN PowerIndicateWaitWakeStatus(__in NTSTATUS WaitWakeStatus)
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
Definition: typedefs.h:119
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING MofResourceName
Definition: wdfdevice.h:2461
NTSTATUS AssignPowerFrameworkSettings(__in PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings)
Definition: fxpkgpnp.cpp:6243
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_Must_inspect_result_ __in WDFDEVICE __in NTSTATUS WaitWakeStatus
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
static unsigned __int64 next
Definition: rand_nt.c:6
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
__in PDEVICE_OBJECT DeviceObject
pFxDriverGlobals
_Must_inspect_result_ __in WDFDEVICE __in PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
VOID SetChildBusInformation(__in PPNP_BUS_INFORMATION BusInformation)
Definition: fxpkgpnp.hpp:3468
__inline WDFFILEOBJECT GetHandle(VOID)
#define NULL
Definition: types.h:112
__in WDFDEVICE __in WDF_SPECIAL_FILE_TYPE __in BOOLEAN Supported
SharedPowerData m_SharedPower
Definition: fxpkgpnp.hpp:4161
FX_TRACK_DRIVER(fxDriverGlobals)
FxPointerNotNull(fxDriverGlobals, Irp)
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define ULONG_PTR
Definition: config.h:101
struct @1636::@1637 driver
#define STATUS_SUCCESS
Definition: shellext.h:65
VOID RemoveRemovalDevice(__in MdDeviceObject DependentDevice)
Definition: fxpkgpnp.cpp:4816
#define TRACINGIO
Definition: dbgtrace.h:66
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE_BASE,(PVOID *) &pDevice)
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrpToIoQueue(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ FxDevice *device, _In_ MdIrp Irp, _In_ FxIoQueue *queue, _In_ ULONG Flags)
_In_ WDFDEVICE _In_ PPNP_BUS_INFORMATION BusInformation
Definition: wdfdevice.h:3912
#define FX_IN_DISPATCH_CALLBACK
Definition: fxpkgio.hpp:39
#define __in
Definition: dbghelp.h:35
FX_DECLARE_VF_FUNCTION_P4(NTSTATUS, VerifyWdfDeviceWdmDispatchIrpToIoQueue, _In_ FxDevice *, _In_ MdIrp, _In_ FxIoQueue *, _In_ ULONG)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680
enum _WDF_SPECIAL_FILE_TYPE WDF_SPECIAL_FILE_TYPE
PIO_STACK_LOCATION stack
FxVerifierDbgBreakPoint(pFxDriverGlobals)
__drv_maxIRQL(DISPATCH_LEVEL) WDFDEVICE STDCALL WDFEXPORT(WdfWdmDeviceGetWdfDeviceHandle)(__in PWDF_DRIVER_GLOBALS DriverGlobals
VOID ClearRemovalDevicesList(VOID)
Definition: fxpkgpnp.cpp:4832
__in WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDEVICE _In_ PDEVICE_OBJECT PhysicalDevice
Definition: wdfdevice.h:2320
BOOLEAN m_WaitWakeOwner
Definition: fxpkgpnp.hpp:186
Definition: ps.c:97