ReactOS  0.4.15-dev-2965-g9a42267
fxdeviceapikm.cpp File Reference
#include "coreprivshared.hpp"
#include "fxiotarget.hpp"
Include dependency graph for fxdeviceapikm.cpp:

Go to the source code of this file.

Functions

 FX_DECLARE_VF_FUNCTION_P3 (VOID, VerifyWdfDeviceWdmDispatchIrp, _In_ PWDF_DRIVER_GLOBALS, _In_ FxDevice *, _In_ WDFCONTEXT)
 
 FX_DECLARE_VF_FUNCTION_P4 (NTSTATUS, VerifyWdfDeviceWdmDispatchIrpToIoQueue, _In_ FxDevice *, _In_ MdIrp, _In_ FxIoQueue *, _In_ ULONG)
 
 __drv_maxIRQL (DISPATCH_LEVEL) WDFDEVICE STDCALL WDFEXPORT(WdfWdmDeviceGetWdfDeviceHandle)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE_BASE,(PVOID *) &pDevice)
 
return pDevice GetDeviceObject ()
 
return pDevice GetAttachedDevice ()
 
return pDevice GetPhysicalDevice ()
 
 FxObjectHandleGetPtr (pFxDriverGlobals, Device, FX_TYPE_DEVICE,(PVOID *)&pDevice)
 
 if (!NT_SUCCESS(status))
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &device, &fxDriverGlobals)
 
 FxPointerNotNull (fxDriverGlobals, Irp)
 
 if (fxDriverGlobals->IsVerificationEnabled(1, 11, OkForDownLevel))
 
return device DispatchPreprocessedIrp (Irp, device->m_PreprocessInfoListHead.Flink->Flink)
 
VOID FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrp (_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_DRIVER_GLOBALS DriverGlobals, _In_ FxDevice *device, _In_ WDFCONTEXT DispatchContext)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &device)
 
 FxPointerNotNull (device->GetDriverGlobals(), Irp)
 
 FxPointerNotNull (device->GetDriverGlobals(), DispatchContext)
 
 if ((UCHAR)(ULONG_PTR) DispatchContext &FX_IN_DISPATCH_CALLBACK)
 
 FX_TRACK_DRIVER (fxDriverGlobals)
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Queue, FX_TYPE_QUEUE,(PVOID *)&queue)
 
 if (Flags &WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP)
 
 if (device->m_ParentDevice==queue->GetDevice())
 
return device m_PkgIo DispatchStep2 (Irp, ioInCallerCtx, queue)
 
 FxPointerNotNull (pFxDriverGlobals, DependentDevice)
 
return pDevice m_PkgPnp AddUsageDevice (DependentDevice)
 
return pDevice m_PkgPnp RemoveUsageDevice (DependentDevice)
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfDeviceAssignMofResourceName)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (pFxDriverGlobals, MofResourceName)
 
 if (pDevice->m_MofResourceName.Buffer !=NULL)
 
 if (FileType< WdfSpecialFilePaging||FileType >=WdfSpecialFileMax)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
 
pDevice m_PkgPnp SetSpecialFileSupport (FileType, Supported)
 
 if (Device==NULL||WaitWakeStatus==STATUS_PENDING||WaitWakeStatus==STATUS_CANCELLED)
 
 if (pDevice->m_PkgPnp->m_SharedPower.m_WaitWakeOwner)
 
 FxPointerNotNull (pDevice->GetDriverGlobals(), BusInformation)
 
pDevice m_PkgPnp SetChildBusInformation (BusInformation)
 
 FxPointerNotNull (pDevice->GetDriverGlobals(), PhysicalDevice)
 
return pDevice m_PkgPnp AddRemovalDevice (PhysicalDevice)
 
pDevice m_PkgPnp RemoveRemovalDevice (PhysicalDevice)
 
pDevice m_PkgPnp ClearRemovalDevicesList ()
 
 FxPointerNotNull (pFxDriverGlobals, PowerFrameworkSettings)
 
 if (pDevice->m_PkgPnp->IsPowerPolicyOwner()==FALSE)
 
 if (PowerFrameworkSettings->Size !=sizeof(WDF_POWER_FRAMEWORK_SETTINGS))
 
 if (NULL !=PowerFrameworkSettings->Component)
 

Variables

__in PDEVICE_OBJECT DeviceObject
 
__in WDFDEVICE Device
 
__in WDFDEVICE __in MdFileObject FileObject
 
NTSTATUS status
 
FxFileObjectpFxFO = NULL
 
FxDevicepDevice
 
 pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
_Must_inspect_result_ __in WDFDEVICE __in MdIrp Irp
 
PFX_DRIVER_GLOBALS fxDriverGlobals = device->GetDriverGlobals()
 
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFCONTEXT DispatchContext
 
 else
 
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE Queue
 
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE __in ULONG Flags
 
FxDevicedevice
 
PIO_STACK_LOCATION stack
 
FxIoInCallerContextioInCallerCtx = NULL
 
 queue = NULL
 
_Must_inspect_result_ __in WDFDEVICE __in PDEVICE_OBJECT DependentDevice
 
_Must_inspect_result_ __in WDFDEVICE __in PCUNICODE_STRING MofResourceName
 
__in WDFDEVICE __in WDF_SPECIAL_FILE_TYPE FileType
 
__in WDFDEVICE __in WDF_SPECIAL_FILE_TYPE __in BOOLEAN Supported
 
_Must_inspect_result_ __in WDFDEVICE __in NTSTATUS WaitWakeStatus
 
__in WDFDEVICE __in PPNP_BUS_INFORMATION BusInformation
 
_Must_inspect_result_ __in WDFDEVICE __in PDEVICE_OBJECT PhysicalDevice
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ AddRemovalDevice()

return pDevice m_PkgPnp AddRemovalDevice ( PhysicalDevice  )

◆ AddUsageDevice()

return pDevice m_PkgPnp AddUsageDevice ( DependentDevice  )

◆ ClearRemovalDevicesList()

pDevice m_PkgPnp ClearRemovalDevicesList ( )

◆ DispatchPreprocessedIrp()

return device DispatchPreprocessedIrp ( Irp  ,
device->m_PreprocessInfoListHead.Flink->  Flink 
)

◆ DispatchStep2()

return device m_PkgIo DispatchStep2 ( Irp  ,
ioInCallerCtx  ,
queue   
)

◆ FX_DECLARE_VF_FUNCTION_P3()

FX_DECLARE_VF_FUNCTION_P3 ( VOID  ,
VerifyWdfDeviceWdmDispatchIrp  ,
_In_  PWDF_DRIVER_GLOBALS,
_In_ FxDevice ,
_In_  WDFCONTEXT 
)

◆ FX_DECLARE_VF_FUNCTION_P4()

FX_DECLARE_VF_FUNCTION_P4 ( NTSTATUS  ,
VerifyWdfDeviceWdmDispatchIrpToIoQueue  ,
_In_ FxDevice ,
_In_  MdIrp,
_In_ FxIoQueue ,
_In_  ULONG 
)

◆ FX_TRACK_DRIVER()

◆ FxObjectHandleGetPtr() [1/5]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE_BASE  ,
(PVOID *) &  pDevice 
)

◆ FxObjectHandleGetPtr() [2/5]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *)&  pDevice 
)

◆ FxObjectHandleGetPtr() [3/5]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  device 
)

◆ FxObjectHandleGetPtr() [4/5]

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Queue  ,
FX_TYPE_QUEUE  ,
(PVOID *)&  queue 
)

◆ FxObjectHandleGetPtr() [5/5]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  pDevice 
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  device,
fxDriverGlobals 
)

◆ FxPointerNotNull() [1/8]

FxPointerNotNull ( fxDriverGlobals  ,
Irp   
)

◆ FxPointerNotNull() [2/8]

FxPointerNotNull ( device->  GetDriverGlobals(),
Irp   
)

◆ FxPointerNotNull() [3/8]

FxPointerNotNull ( device->  GetDriverGlobals(),
DispatchContext   
)

◆ FxPointerNotNull() [4/8]

FxPointerNotNull ( pFxDriverGlobals  ,
DependentDevice   
)

◆ FxPointerNotNull() [5/8]

FxPointerNotNull ( pFxDriverGlobals  ,
MofResourceName   
)

◆ FxPointerNotNull() [6/8]

FxPointerNotNull ( pDevice->  GetDriverGlobals(),
BusInformation   
)

◆ FxPointerNotNull() [7/8]

FxPointerNotNull ( pDevice->  GetDriverGlobals(),
PhysicalDevice   
)

◆ FxPointerNotNull() [8/8]

FxPointerNotNull ( pFxDriverGlobals  ,
PowerFrameworkSettings   
)

◆ GetAttachedDevice()

return pDevice GetAttachedDevice ( )

◆ GetDeviceObject()

return pDevice GetDeviceObject ( )

◆ GetPhysicalDevice()

return pDevice GetPhysicalDevice ( )

◆ if() [1/12]

if ( NT_SUCCESSstatus)

Definition at line 197 of file fxdeviceapikm.cpp.

197  {
200  "FxFileObject::_GetFileObjectFromWdm returned an error %!STATUS!",
201  status);
202  return NULL;
203  }
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
Definition: ps.c:97

Referenced by VerifyWdfDeviceWdmDispatchIrp().

◆ if() [2/12]

if ( fxDriverGlobals->  IsVerificationEnabled1, 11, OkForDownLevel)

Definition at line 242 of file fxdeviceapikm.cpp.

242  {
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  }
struct @1654::@1655 driver
DriverGlobals
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
Definition: devices.h:37
FxDriver * Driver
Definition: fxglobals.h:374
PFX_DRIVER_GLOBALS fxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define TRACINGIO
Definition: dbgtrace.h:66
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [3/12]

if ( (UCHAR)(ULONG_PTR) DispatchContext FX_IN_DISPATCH_CALLBACK)

Definition at line 371 of file fxdeviceapikm.cpp.

371  {
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  }
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT _Inout_ PIRP _In_ WDFCONTEXT DispatchContext
Definition: wdfdevice.h:1697
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PIRP Irp
Definition: csq.h:116
Definition: devices.h:37
PVOID WDFCONTEXT
Definition: wdftypes.h:94
#define FX_IN_DISPATCH_CALLBACK
Definition: fxpkgio.hpp:39
Definition: ps.c:97

◆ if() [4/12]

if ( Flags WDF_DISPATCH_IRP_TO_IO_QUEUE_PREPROCESSED_IRP)

Definition at line 450 of file fxdeviceapikm.cpp.

450  {
452  }
_In_ PIRP Irp
Definition: csq.h:116
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680

◆ if() [5/12]

if ( device->  m_ParentDevice = queue->GetDevice())

Definition at line 473 of file fxdeviceapikm.cpp.

473  {
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  }
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2868
_In_ PIRP Irp
Definition: csq.h:116
Definition: devices.h:37
Definition: _stack.h:47
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680

◆ if() [6/12]

Definition at line 593 of file fxdeviceapikm.cpp.

593  {
595 
598  "WDFDEVICE %p MofResourceName already assigned, %!STATUS!",
599  Device, status);
600 
601  return status;
602  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
Definition: ps.c:97

◆ if() [7/12]

Definition at line 641 of file fxdeviceapikm.cpp.

641  {
644  "WDFDEVICE 0x%p FileType %d specified is not in valid range",
645  Device, FileType);
647  return;
648  }
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
Definition: wdfdevice.h:2739
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [8/12]

Definition at line 681 of file fxdeviceapikm.cpp.

682  {
684  "NULL WDFDEVICE handle %p or invalid %!STATUS!",
687  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ NTSTATUS WaitWakeStatus
Definition: wdfdevice.h:3942
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)

◆ if() [9/12]

if ( pDevice->m_PkgPnp->m_SharedPower.  m_WaitWakeOwner)

Definition at line 689 of file fxdeviceapikm.cpp.

689  {
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  }
FxDevice * pDevice
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_Must_inspect_result_ _In_ WDFDEVICE _In_ NTSTATUS WaitWakeStatus
Definition: wdfdevice.h:3942
#define TRACINGDEVICE
Definition: dbgtrace.h:58
BOOLEAN PowerIndicateWaitWakeStatus(__in NTSTATUS WaitWakeStatus)
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: ps.c:97

◆ if() [10/12]

if ( pDevice->m_PkgPnp->  IsPowerPolicyOwner() = FALSE)

Definition at line 914 of file fxdeviceapikm.cpp.

914  {
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  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

◆ if() [11/12]

Definition at line 927 of file fxdeviceapikm.cpp.

927  {
931  "WDFDEVICE 0x%p Expected PowerFrameworkSettings size %d, actual %d,"
932  " %!STATUS!",
933  Device,
936  status);
938  return status;
939  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
Definition: wdfdevice.h:4332
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

◆ if() [12/12]

Definition at line 945 of file fxdeviceapikm.cpp.

945  {
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  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_POWER_FRAMEWORK_SETTINGS PowerFrameworkSettings
Definition: wdfdevice.h:4332
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
pFxDriverGlobals
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

◆ RemoveRemovalDevice()

pDevice m_PkgPnp RemoveRemovalDevice ( PhysicalDevice  )

◆ RemoveUsageDevice()

return pDevice m_PkgPnp RemoveUsageDevice ( DependentDevice  )

◆ SetChildBusInformation()

pDevice m_PkgPnp SetChildBusInformation ( BusInformation  )

◆ SetSpecialFileSupport()

pDevice m_PkgPnp SetSpecialFileSupport ( FileType  ,
Supported   
)

◆ VerifyWdfDeviceWdmDispatchIrp()

VOID FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrp ( _In_ PFX_DRIVER_GLOBALS  FxDriverGlobals,
_In_ PWDF_DRIVER_GLOBALS  DriverGlobals,
_In_ FxDevice device,
_In_ WDFCONTEXT  DispatchContext 
)

Definition at line 267 of file fxdeviceapikm.cpp.

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 }
struct _LIST_ENTRY * PLIST_ENTRY
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT _Inout_ PIRP _In_ WDFCONTEXT DispatchContext
Definition: wdfdevice.h:1697
struct @1654::@1655 driver
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
if(!NT_SUCCESS(status))
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
DriverGlobals
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFCONTEXT DispatchContext
#define FALSE
Definition: types.h:117
Definition: devices.h:37
NTSTATUS status
FxDriver * Driver
Definition: fxglobals.h:374
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
unsigned char BOOLEAN
BOOLEAN ctxValid
Definition: fxpkgio.cpp:129
Definition: typedefs.h:119
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
static unsigned __int64 next
Definition: rand_nt.c:6
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACINGIO
Definition: dbgtrace.h:66
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

Variable Documentation

◆ BusInformation

Initial value:
{
FxDevice * pDevice

Definition at line 731 of file fxdeviceapikm.cpp.

◆ DependentDevice

◆ Device

Initial value:

Definition at line 83 of file fxdeviceapikm.cpp.

◆ device

Definition at line 420 of file fxdeviceapikm.cpp.

◆ DeviceObject

Initial value:
{
DriverGlobals
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
FxPointerNotNull(fxDriverGlobals, Irp)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597

Definition at line 68 of file fxdeviceapikm.cpp.

◆ DispatchContext

◆ else

else
Initial value:
{
FxDevice * device
VOID FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrp(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_DRIVER_GLOBALS DriverGlobals, _In_ FxDevice *device, _In_ WDFCONTEXT DispatchContext)
DriverGlobals
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFCONTEXT DispatchContext
Definition: devices.h:37

Definition at line 383 of file fxdeviceapikm.cpp.

◆ FileObject

Initial value:

Definition at line 162 of file fxdeviceapikm.cpp.

◆ FileType

Definition at line 625 of file fxdeviceapikm.cpp.

◆ Flags

Initial value:

Definition at line 418 of file fxdeviceapikm.cpp.

◆ fxDriverGlobals

fxDriverGlobals = device->GetDriverGlobals()

Definition at line 225 of file fxdeviceapikm.cpp.

Referenced by if().

◆ ioInCallerCtx

ioInCallerCtx = NULL

Definition at line 424 of file fxdeviceapikm.cpp.

Referenced by FxPkgIo::DispatchStep1(), and FxIoTargetSelf::Send().

◆ Irp

Initial value:

Definition at line 223 of file fxdeviceapikm.cpp.

◆ MofResourceName

◆ pDevice

FxDevice* pDevice

Definition at line 166 of file fxdeviceapikm.cpp.

Referenced by if().

◆ pFxDriverGlobals

Definition at line 168 of file fxdeviceapikm.cpp.

Referenced by if().

◆ pFxFO

◆ PhysicalDevice

Initial value:
{
FxDevice * pDevice

Definition at line 773 of file fxdeviceapikm.cpp.

◆ PowerFrameworkSettings

Initial value:
{
LONG NTSTATUS
Definition: precomp.h:26
Definition: ps.c:97

Definition at line 894 of file fxdeviceapikm.cpp.

◆ Queue

Definition at line 410 of file fxdeviceapikm.cpp.

◆ queue

Definition at line 426 of file fxdeviceapikm.cpp.

◆ stack

Definition at line 422 of file fxdeviceapikm.cpp.

◆ status

Initial value:
)
__in WDFDEVICE __in MdFileObject FileObject
FxDevice * pDevice
FxFileObject * pFxFO
__inline WDF_FILEOBJECT_CLASS GetFileObjectClass(VOID)
Definition: fxdevice.hpp:1123
static _Must_inspect_result_ NTSTATUS _GetFileObjectFromWdm(__in FxDevice *pDevice, __in WDF_FILEOBJECT_CLASS FileObjectClass, __in_opt MdFileObject pWdmFileObject, __deref_out_opt FxFileObject **ppFxFileObject)

Definition at line 164 of file fxdeviceapikm.cpp.

Referenced by if(), and VerifyWdfDeviceWdmDispatchIrp().

◆ Supported

Initial value:
{
FxDevice * pDevice

Definition at line 631 of file fxdeviceapikm.cpp.

◆ WaitWakeStatus

Initial value:
{
LONG NTSTATUS
Definition: precomp.h:26
Definition: ps.c:97

Definition at line 670 of file fxdeviceapikm.cpp.