ReactOS  0.4.15-dev-1632-g4e289ce
fxdeviceapi.cpp File Reference
#include "coreprivshared.hpp"
#include "fxiotarget.hpp"
Include dependency graph for fxdeviceapi.cpp:

Go to the source code of this file.

Classes

struct  FxOffsetAndName
 

Macros

#define OFFSET_AND_NAME(type, offset)   { #offset, FIELD_OFFSET(type, offset) }
 

Functions

 __drv_maxIRQL (DISPATCH_LEVEL) WDFDRIVER STDCALL WDFEXPORT(WdfDeviceGetDriver)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
 
return pDevice GetDriver () -> GetHandle()
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE_BASE,(PVOID *) &pDeviceBase)
 
 if (pTarget !=NULL)
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) WDFIOTARGET STDCALL WDFEXPORT(WdfDeviceGetSelfIoTarget)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfDeviceRetrieveDeviceName)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
 
 if (!NT_SUCCESS(status))
 
 FxObjectHandleGetPtr (pFxDriverGlobals, String, FX_TYPE_STRING,(PVOID *) &pString)
 
 if (pDevice->m_DeviceName.Buffer !=NULL)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
 
deviceObject SetObject (pDevice->GetDeviceObject())
 
deviceObject SetCharacteristics (DeviceCharacteristics|FILE_DEVICE_SECURE_OPEN)
 
return deviceObject GetCharacteristics ()
 
deviceObject SetObject (pDeviceBase->GetDeviceObject())
 
return deviceObject GetAlignmentRequirement ()
 
deviceObject SetAlignmentRequirement (AlignmentRequirement)
 
return pDevice GetDevicePnpState ()
 
return pDevice GetDevicePowerState ()
 
return pDevice GetDevicePowerPolicyState ()
 
 FxPointerNotNull (pFxDriverGlobals, Settings)
 
 if (pDevice->m_PkgPnp->IsPowerPolicyOwner()==FALSE)
 
 if (Settings->Size !=sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS) &&Settings->Size !=sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9) &&Settings->Size !=sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_7))
 
else if (Settings->DxState< PowerDeviceD1||Settings->DxState > PowerDeviceMaximum||Settings->IdleCaps< IdleCannotWakeFromS0||Settings->IdleCaps > IdleUsbSelectiveSuspend||Settings->UserControlOfIdleSettings< IdleDoNotAllowUserControl||Settings->UserControlOfIdleSettings > IdleAllowUserControl||Settings->Enabled< WdfFalse||Settings->Enabled > WdfUseDefault)
 
 if (Settings->Size > sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_7))
 
 if (Settings->Size > sizeof(WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9))
 
return pDevice m_PkgPnp PowerPolicySetS0IdleSettings (Settings)
 
else if (Settings->DxState< PowerDeviceD1||Settings->DxState > PowerDeviceMaximum||Settings->UserControlOfWakeSettings< WakeDoNotAllowUserControl||Settings->UserControlOfWakeSettings > WakeAllowUserControl||Settings->Enabled< WdfFalse||Settings->Enabled > WdfUseDefault)
 
return pDevice m_PkgPnp PowerPolicySetSxWakeSettings (Settings, armForWakeIfChildrenAreArmedForWake, indicateChildWakeOnParentWake)
 
 FxPointerNotNull (pFxDriverGlobals, Key)
 
_Must_inspect_result_ _IRQL_requires_max_ (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfDeviceOpenDevicemapKey)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
 if (KeyName->Length==0)
 
 if (pKey==NULL)
 
pKey SetDeviceBase (pDevice)
 
 if (NT_SUCCESS(status))
 
 FxPointerNotNull (pFxDriverGlobals, DeviceState)
 
 if (DeviceState->Size !=sizeof(WDF_DEVICE_STATE))
 
pDevice m_PkgPnp GetPnpState (DeviceState)
 
 for (i=0;i< ARRAY_SIZE(offsets);i++)
 
pDevice m_PkgPnp SetPnpState (DeviceState)
 
pDevice InvalidateDeviceState ()
 
 FxPointerNotNull (pFxDriverGlobals, DeviceInit)
 
 FxPointerNotNull (pFxDriverGlobals, *DeviceInit)
 
 FxPointerNotNull (pFxDriverGlobals, Device)
 
 if ((*DeviceInit) ->CreatedDevice !=NULL)
 
 if ((*DeviceInit) ->Security.Sddl !=NULL||(*DeviceInit) ->Security.DeviceClassSet)
 
 if ((*DeviceInit) ->RequiresSelfIoTarget)
 
 FxPointerNotNull (pFxDriverGlobals, SymbolicLinkName)
 
 if (pDevice->m_SymbolicLinkName.Buffer !=NULL)
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in ULONG __out_bcount_full (BufferLength) PVOID PropertyBuffer
 
 FxPointerNotNull (pFxDriverGlobals, ResultLength)
 
 if (BufferLength > 0)
 
 if (pDevice->IsLegacy())
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGDEVICE, "exit WDFDEVICE %p, Property %d, %!STATUS!", Device, DeviceProperty, status)
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch (__drv_typeExpr) POOL_TYPE PoolType
 
 FxPointerNotNull (pFxDriverGlobals, PropertyMemory)
 
 FxVerifierCheckNxPoolType (pFxDriverGlobals, PoolType, pFxDriverGlobals->Tag)
 
 if (Stoppable)
 
 if (FailedAction< WdfDeviceFailedAttemptRestart||FailedAction > WdfDeviceFailedNoRestart)
 
 DoTraceLevelMessage (pFxDriverGlobals, TRACE_LEVEL_INFORMATION, TRACINGDEVICE, "WDFDEVICE %p, !devobj %p SetFailed %!WDF_DEVICE_FAILED_ACTION!", Device, pDevice->GetDeviceObject(), FailedAction)
 
pDevice m_PkgPnp SetDeviceFailed (FailedAction)
 
__inline NTSTATUS StopIdleWorker (__in PWDF_DRIVER_GLOBALS DriverGlobals, __in WDFDEVICE Device, __in BOOLEAN WaitForD0, __in PVOID Tag, __in LONG Line, __in PSTR File)
 
__inline VOID ResumeIdleWorker (__in PWDF_DRIVER_GLOBALS DriverGlobals, __in WDFDEVICE Device, __in PVOID Tag, __in LONG Line, __in PSTR File)
 
_Must_inspect_result_ __drv_when (WaitForD0==0, __drv_maxIRQL(DISPATCH_LEVEL)) __drv_when(WaitForD0 !=0
 
 ResumeIdleWorker (DriverGlobals, Device, NULL, 0, NULL)
 
 ResumeIdleWorker (DriverGlobals, Device, Tag, Line, File)
 
 FxPointerNotNull (pFxDriverGlobals, PnpCapabilities)
 
 if (PnpCapabilities->Size !=sizeof(WDF_DEVICE_PNP_CAPABILITIES))
 
 FxPointerNotNull (pFxDriverGlobals, PowerCapabilities)
 
 if (PowerCapabilities->Size !=sizeof(WDF_DEVICE_POWER_CAPABILITIES))
 
_Must_inspect_result_ __in WDFDEVICE __in WDFQUEUE __in __drv_strictTypeMatch (__drv_typeCond) WDF_REQUEST_TYPE RequestType)
 
 if (pFxIoQueue==NULL)
 
 return (WDFQUEUE) pFxIoQueue -> GetObjectHandle()
 
 FxObjectHandleGetPtr (pFxDriverGlobals, Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, Request, FX_TYPE_REQUEST,(PVOID *) &pRequest)
 
return pDevice m_PkgIo EnqueueRequest (pDevice, pRequest)
 
return pDevice m_PkgPnp GetSystemPowerAction ()
 
_Must_inspect_result_ _IRQL_requires_max_ (APC_LEVEL) WDFAPI NTSTATUS STDCALL WDFEXPORT(WdfDeviceQueryPropertyEx)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxPointerNotNull (pFxDriverGlobals, DeviceProperty)
 
 if (DeviceProperty->Size !=sizeof(WDF_DEVICE_PROPERTY_DATA))
 
 FxPointerNotNull (pFxDriverGlobals, RequiredSize)
 
 FxPointerNotNull (pFxDriverGlobals, Type)
 
 if (BufferLength !=0 &&PropertyBuffer==NULL)
 
 if (BufferLength==0 &&PropertyBuffer !=NULL)
 
 switch (MajorFunction)
 
 if (Driver !=NULL)
 
 FxPointerNotNull (pFxDriverGlobals, EvtDeviceWdmIrpDispatch)
 
_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)
 

Variables

__in WDFDEVICE Device
 
FxDevicepDevice = NULL
 
FxIoTargetpTarget = pDeviceBase->GetDefaultIoTarget()
 
FxDeviceBasepDeviceBase
 
return NULL
 
_Must_inspect_result_ __in WDFDEVICE __in WDFSTRING String
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
FxStringpString
 
NTSTATUS status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
 else
 
__in WDFDEVICE __in ULONG DeviceCharacteristics
 
MxDeviceObject deviceObject
 
__in WDFDEVICE __in ULONG AlignmentRequirement
 
_Must_inspect_result_ __in WDFDEVICE __in PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
 
BOOLEAN armForWakeIfChildrenAreArmedForWake
 
BOOLEAN indicateChildWakeOnParentWake
 
_Must_inspect_result_ __in WDFDEVICE __in ULONG DeviceInstanceKeyType
 
_Must_inspect_result_ __in WDFDEVICE __in ULONG __in ACCESS_MASK DesiredAccess
 
_Must_inspect_result_ __in WDFDEVICE __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES KeyAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in ULONG __in ACCESS_MASK __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFKEY * Key
 
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
 
FxRegKeypKey = NULL
 
WDFKEY keyHandle
 
__in WDFDEVICE __out PWDF_DEVICE_STATE DeviceState
 
ULONG i
 
static const FxOffsetAndName offsets []
 
_Must_inspect_result_ __inout PWDFDEVICE_INITDeviceInit
 
_Must_inspect_result_ __inout PWDFDEVICE_INIT __in_opt PWDF_OBJECT_ATTRIBUTES DeviceAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in PCUNICODE_STRING SymbolicLinkName
 
FxAutoString pdoName
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY DeviceProperty
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in ULONG BufferLength
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in ULONG __out PULONG ResultLength
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
 
_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFMEMORY * PropertyMemory
 
__in WDFDEVICE __in BOOLEAN Stoppable
 
 return
 
__in WDFDEVICE __in WDF_DEVICE_FAILED_ACTION FailedAction
 
_Must_inspect_result_ __in WDFDEVICE __in BOOLEAN WaitForD0
 
_Must_inspect_result_ __in WDFDEVICE __in BOOLEAN __in_opt PVOID Tag
 
_Must_inspect_result_ __in WDFDEVICE __in BOOLEAN __in_opt PVOID __in LONG Line
 
_Must_inspect_result_ __in WDFDEVICE __in BOOLEAN __in_opt PVOID __in LONG __in PSTR File
 
__in WDFDEVICE __in PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities
 
__in WDFDEVICE __in PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
 
_Must_inspect_result_ __in WDFDEVICE __in WDFQUEUE Queue
 
FxPkgIopPkgIo = NULL
 
FxIoQueuepFxIoQueue = NULL
 
FxDevicepFxDevice
 
_Must_inspect_result_ __in WDFDEVICE __in WDFREQUEST Request
 
FxRequestpRequest
 
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
 
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
 
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG _Out_ PDEVPROPTYPE Type
 
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ _Strict_type_match_ POOL_TYPE PoolType
 
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER Driver
 
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER _In_ UCHAR MajorFunction
 
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER _In_ UCHAR _In_ PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDispatch
 
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER _In_ UCHAR _In_ PFN_WDFDEVICE_WDM_IRP_DISPATCH _In_opt_ WDFCONTEXT DriverContext
 
FxCxDeviceInfopCxDeviceInfo = NULL
 
ULONG deviceFlags
 
exit __pad5__
 

Macro Definition Documentation

◆ OFFSET_AND_NAME

#define OFFSET_AND_NAME (   type,
  offset 
)    { #offset, FIELD_OFFSET(type, offset) }

Definition at line 37 of file fxdeviceapi.cpp.

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_strictTypeMatch() [1/2]

_Must_inspect_result_ __in WDFDEVICE __in DEVICE_REGISTRY_PROPERTY __in __drv_strictTypeMatch ( __drv_typeExpr  )

◆ __drv_strictTypeMatch() [2/2]

_Must_inspect_result_ __in WDFDEVICE __in WDFQUEUE __in __drv_strictTypeMatch ( __drv_typeCond  )

Definition at line 1773 of file fxdeviceapi.cpp.

1802 {
1803  DDI_ENTRY();
1804 
1806  NTSTATUS status;
1807  FxDevice* pDevice;
1809 
1810  pDevice = NULL;
1811  pFxIoQueue = NULL;
1812 
1814  Device,
1816  (PVOID *) &pDevice,
1817  &pFxDriverGlobals);
1818 
1826  "Invalid RequestType %!WDF_REQUEST_TYPE!, %!STATUS!",
1827  RequestType, status);
1828  return status;
1829  }
1830 
1831  //
1832  // Validate the Queue handle
1833  //
1835  Queue,
1836  FX_TYPE_QUEUE,
1837  (PVOID*)&pFxIoQueue);
1838 
1839  if (pDevice != pFxIoQueue->GetDevice()) {
1841 
1844  "Input WDFQUEUE 0x%p doesn't belong to the WDFDEVICE 0x%p, %!STATUS!",
1845  Queue, Device, status);
1846 
1847  return status;
1848  }
1849 
1850  if (pDevice->IsLegacy()) {
1851  //
1852  // This is a controldevice. Make sure the create is called after the device
1853  // is initialized and ready to accept I/O.
1854  //
1857 
1861  "Queue cannot be configured for automatic dispatching"
1862  " after WdfControlDeviceFinishInitializing"
1863  "is called on the WDFDEVICE %p is called %!STATUS!",
1864  Device,
1865  status);
1866  return status;
1867  }
1868  }
1869  else {
1870  //
1871  // This is either FDO or PDO. Make sure it's not started yet.
1872  //
1877  "Queue cannot be configured for automatic dispatching"
1878  "after the WDFDEVICE %p is started, %!STATUS!",
1879  Device, status);
1880  return status;
1881  }
1882  }
1883 
1886  }
1887  else {
1889  }
1890 
1891  return status;
1892 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
FxIoQueue * pFxIoQueue
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
GLint x0
Definition: linetemp.h:95
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2221
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
DriverGlobals
__inline BOOLEAN IsLegacy(VOID)
Definition: fxdevice.hpp:1209
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
Definition: wdfdevice.h:4227
return NULL
NTSTATUS status
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
_Must_inspect_result_ NTSTATUS ConfigureForwarding(__in FxIoQueue *FxQueue)
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
__inline WDF_DEVICE_PNP_STATE GetDevicePnpState()
Definition: fxdevice.hpp:1149
FxPkgIo * m_PkgIo
Definition: fxdevice.hpp:669
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
MxDeviceObject deviceObject
FxPkgGeneral * m_PkgGeneral
Definition: fxdevice.hpp:671
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
_Must_inspect_result_ NTSTATUS ConfigureForwarding(__inout FxIoQueue *TargetQueue, __in WDF_REQUEST_TYPE RequestType)
Definition: fxpkgio.cpp:910
__inline CfxDevice * GetDevice(VOID)
Definition: fxioqueue.hpp:773
#define TRACINGIO
Definition: dbgtrace.h:66
ULONG GetFlags(VOID)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ __drv_when()

_Must_inspect_result_ __drv_when ( WaitForD0  = = 0,
__drv_maxIRQL(DISPATCH_LEVEL  
)
pure virtual

◆ __out_bcount_full()

◆ _IRQL_requires_max_() [1/3]

_IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 3557 of file common.c.

3587 {
3588  NTSTATUS status;
3589  BOOLEAN requestSent = FALSE;
3590 
3591  BOOLEAN shouldRetry = TRUE;
3592  PCDB cdb = (PCDB)DeviceExtension->PowerContext.Srb.Cdb;
3593  ULONG timeoutValue = DeviceExtension->TimeOutValue;
3594  ULONG retryCount = 1;
3595 
3596  // reset some fields.
3597  DeviceExtension->PowerContext.RetryIntervalIn100ns = 0;
3598  status = PowerContextReuseRequest(DeviceExtension);
3599  RequestClearSendTime(DeviceExtension->PowerContext.PowerRequest);
3600 
3601  if (!NT_SUCCESS(status))
3602  {
3603  return status;
3604  }
3605 
3606  // set proper timeout value and max retry count.
3607  switch(DeviceExtension->PowerContext.PowerChangeState.PowerDown)
3608  {
3612  break;
3613 
3614  case PowerDownDeviceLocked:
3615  // Case of issuing SYNC CACHE command. Do not use power irp timeout remaining time in this case
3616  // as we want to give best try on SYNC CACHE command.
3617  retryCount = MAXIMUM_RETRIES;
3618  timeoutValue = DeviceExtension->TimeOutValue;
3619  break;
3620 
3622  {
3623  // Case of issuing STOP UNIT command
3624  // As "Imme" bit is set to '1', this command should be completed in short time.
3625  // This command is at low importance, failure of this command has very small impact.
3626  ULONG secondsRemaining = 0;
3627 
3628 #if (WINVER >= 0x0601)
3629  // this API is introduced in Windows7
3630  PoQueryWatchdogTime(DeviceExtension->LowerPdo, &secondsRemaining);
3631 #endif
3632 
3633  if (secondsRemaining == 0)
3634  {
3635  // not able to retrieve remaining time from PoQueryWatchdogTime API, use default values.
3636  retryCount = MAXIMUM_RETRIES;
3637  timeoutValue = SCSI_CDROM_TIMEOUT;
3638  }
3639  else
3640  {
3641  // plan to leave about 30 seconds to lower level drivers if possible.
3642  if (secondsRemaining >= 32)
3643  {
3644  retryCount = (secondsRemaining - 30)/SCSI_CDROM_TIMEOUT + 1;
3645  timeoutValue = SCSI_CDROM_TIMEOUT;
3646 
3647  if (retryCount > MAXIMUM_RETRIES)
3648  {
3649  retryCount = MAXIMUM_RETRIES;
3650  }
3651 
3652  if (retryCount == 1)
3653  {
3654  timeoutValue = secondsRemaining - 30;
3655  }
3656  }
3657  else
3658  {
3659  // issue the command with minimal timeout value and do not retry on it.
3660  retryCount = 1;
3661  timeoutValue = 2;
3662  }
3663  }
3664  }
3665  break;
3666  default:
3667  NT_ASSERT( FALSE );
3669  return status;
3670  }
3671 
3672  DeviceExtension->PowerContext.RetryCount = retryCount;
3673 
3674  // issue command.
3675  while (shouldRetry)
3676  {
3677 
3678  // set SRB fields.
3679  DeviceExtension->PowerContext.Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER |
3684 
3685  DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
3686  DeviceExtension->PowerContext.Srb.TimeOutValue = timeoutValue;
3687 
3688  if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceInitial)
3689  {
3690  DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_LOCK_QUEUE;
3691  }
3692  else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceLocked)
3693  {
3694  DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_QUIESCE_DEVICE;
3695  }
3696  else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3697  {
3698  // Case of issuing SYNC CACHE command.
3699  DeviceExtension->PowerContext.Srb.CdbLength = 10;
3700  cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE;
3701  }
3702  else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceFlushed)
3703  {
3704  // Case of issuing STOP UNIT command.
3705  DeviceExtension->PowerContext.Srb.CdbLength = 6;
3706  cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT;
3707  cdb->START_STOP.Start = 0;
3708  cdb->START_STOP.Immediate = 1;
3709  }
3710  else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceStopped)
3711  {
3712  DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE;
3713  }
3714 
3715  // Set up completion routine and context if requested
3716  if (CompletionRoutine)
3717  {
3718  WdfRequestSetCompletionRoutine(DeviceExtension->PowerContext.PowerRequest,
3720  Context);
3721  }
3722 
3723  status = RequestSend(DeviceExtension,
3724  DeviceExtension->PowerContext.PowerRequest,
3725  DeviceExtension->IoTarget,
3727  &requestSent);
3728 
3729  if (requestSent)
3730  {
3731  if ((CompletionRoutine == NULL) &&
3732  (SRB_STATUS(DeviceExtension->PowerContext.Srb.SrbStatus) != SRB_STATUS_SUCCESS))
3733  {
3734  TracePrint((TRACE_LEVEL_ERROR,
3735  TRACE_FLAG_POWER,
3736  "%p\tError occured when issuing %s command to device. Srb %p, Status %x\n",
3737  DeviceExtension->PowerContext.PowerRequest,
3738  (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced) ? "SYNC CACHE" : "STOP UNIT",
3739  &DeviceExtension->PowerContext.Srb,
3740  DeviceExtension->PowerContext.Srb.SrbStatus));
3741 
3742  NT_ASSERT(!(TEST_FLAG(DeviceExtension->PowerContext.Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN)));
3743 
3744  shouldRetry = RequestSenseInfoInterpret(DeviceExtension,
3745  DeviceExtension->PowerContext.PowerRequest,
3746  &(DeviceExtension->PowerContext.Srb),
3747  retryCount - DeviceExtension->PowerContext.RetryCount,
3748  &status,
3749  &(DeviceExtension->PowerContext.RetryIntervalIn100ns));
3750 
3751  if (shouldRetry && (DeviceExtension->PowerContext.RetryCount-- == 0))
3752  {
3753  shouldRetry = FALSE;
3754  }
3755  }
3756  else
3757  {
3758  // succeeded, do not need to retry.
3759  shouldRetry = FALSE;
3760  }
3761 
3762  }
3763  else
3764  {
3765  // request failed to be sent
3766  shouldRetry = FALSE;
3767  }
3768 
3769  if (shouldRetry)
3770  {
3771  LARGE_INTEGER t;
3772  t.QuadPart = -DeviceExtension->PowerContext.RetryIntervalIn100ns;
3774 
3775  status = PowerContextReuseRequest(DeviceExtension);
3776  if (!NT_SUCCESS(status))
3777  {
3778  shouldRetry = FALSE;
3779  }
3780  }
3781  }
3782 
3783  if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3784  {
3785  // record SYNC CACHE command completion time stamp.
3786  KeQueryTickCount(&DeviceExtension->PowerContext.Step1CompleteTime);
3787  }
3788 
3789  return status;
3790 }
#define SRB_FUNCTION_UNLOCK_QUEUE
Definition: srb.h:325
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define SRB_FUNCTION_QUIESCE_DEVICE
Definition: srb.h:90
#define SRB_FLAGS_NO_QUEUE_FREEZE
Definition: srb.h:396
#define TRUE
Definition: types.h:120
Definition: cdrw_hw.h:28
LONG NTSTATUS
Definition: precomp.h:26
struct _CDB::_SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10
GLdouble GLdouble t
Definition: gl.h:2047
#define SRB_STATUS(Status)
Definition: srb.h:381
VOID RequestClearSendTime(_In_ WDFREQUEST Request)
Definition: common.c:111
#define MAXIMUM_RETRIES
Definition: cdrom.h:124
return STATUS_NOT_IMPLEMENTED
#define SCSI_CDROM_TIMEOUT
Definition: cdrom.c:170
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
#define SRB_FLAGS_BYPASS_LOCKED_QUEUE
Definition: srb.h:402
unsigned char BOOLEAN
union _CDB * PCDB
struct _CDB::_START_STOP START_STOP
VOID NTAPI KeQueryTickCount(IN PLARGE_INTEGER TickCount)
Definition: clock.c:165
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
Definition: srb.h:389
#define SRB_FLAGS_NO_DATA_TRANSFER
Definition: srb.h:394
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2467
#define SRB_STATUS_QUEUE_FROZEN
Definition: srb.h:378
NTSTATUS RequestSend(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDFIOTARGET IoTarget, _In_ ULONG Flags, _Out_opt_ PBOOLEAN RequestSent)
Definition: common.c:3793
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:893
#define NULL
Definition: types.h:112
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:307
unsigned int ULONG
Definition: retypes.h:1
#define SRB_STATUS_SUCCESS
Definition: srb.h:333
#define SRB_FLAGS_D3_PROCESSING
Definition: srb.h:156
static SERVICE_STATUS status
Definition: service.c:31
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SRB_FUNCTION_LOCK_QUEUE
Definition: srb.h:324
#define NT_ASSERT
Definition: rtlfuncs.h:3312
Definition: ps.c:97

◆ _IRQL_requires_max_() [2/3]

_Must_inspect_result_ _IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 64 of file Messaging.c.

75 {
76  PFLT_SERVER_PORT_OBJECT PortObject;
78 
79  /* The caller must allow at least one connection */
80  if (MaxConnections == 0)
81  {
83  }
84 
85  /* The request must be for a kernel handle */
86  if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87  {
89  }
90 
91  /*
92  * Get rundown protection on the target to stop the owner
93  * from unloading whilst this port object is open. It gets
94  * removed in the FltpServerPortClose callback
95  */
97  if (!NT_SUCCESS(Status))
98  {
99  return Status;
100  }
101 
102  /* Create the server port object for this filter */
106  KernelMode,
107  NULL,
108  sizeof(FLT_SERVER_PORT_OBJECT),
109  0,
110  0,
111  (PVOID *)&PortObject);
112  if (NT_SUCCESS(Status))
113  {
114  /* Zero out the struct */
115  RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116 
117  /* Increment the ref count on the target filter */
119 
120  /* Setup the filter port object */
121  PortObject->Filter = Filter;
122  PortObject->ConnectNotify = ConnectNotifyCallback;
124  PortObject->MessageNotify = MessageNotifyCallback;
125  PortObject->Cookie = ServerPortCookie;
126  PortObject->MaxConnections = MaxConnections;
127 
128  /* Insert the object */
129  Status = ObInsertObject(PortObject,
130  NULL,
132  0,
133  NULL,
135  if (NT_SUCCESS(Status))
136  {
137  /* Lock the connection list */
139 
140  /* Add the new port object to the connection list and increment the count */
143 
144  /* Unlock the connection list*/
146  }
147  }
148 
149  if (!NT_SUCCESS(Status))
150  {
151  /* Allow the filter to be cleaned up */
153  }
154 
155  return Status;
156 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _Outptr_ PFLT_PORT * ServerPort
Definition: fltkernel.h:1873
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
LONG NTSTATUS
Definition: precomp.h:26
#define InsertTailList(ListHead, Entry)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
LIST_ENTRY mList
Definition: fltmgrint.h:56
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:952
Status
Definition: gdiplustypes.h:24
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1873
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1873
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2932
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1873
#define NULL
Definition: types.h:112
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY _In_ LONG MaxConnections
Definition: fltkernel.h:1873
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1873
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121

◆ _IRQL_requires_max_() [3/3]

_Must_inspect_result_ _IRQL_requires_max_ ( APC_LEVEL  )

Definition at line 197 of file cddata.c.

254 {
255  THREAD_CONTEXT ThreadContext = {0};
256  PIRP_CONTEXT IrpContext = NULL;
257  BOOLEAN Wait;
258 
259 #ifdef CD_SANITY
260  PVOID PreviousTopLevel;
261 #endif
262 
264 
265 #if DBG
266 
267  KIRQL SaveIrql = KeGetCurrentIrql();
268 
269 #endif
270 
272 
274 
276 
277 #ifdef CD_SANITY
278  PreviousTopLevel = IoGetTopLevelIrp();
279 #endif
280 
281  //
282  // Loop until this request has been completed or posted.
283  //
284 
285  do {
286 
287  //
288  // Use a try-except to handle the exception cases.
289  //
290 
291  _SEH2_TRY {
292 
293  //
294  // If the IrpContext is NULL then this is the first pass through
295  // this loop.
296  //
297 
298  if (IrpContext == NULL) {
299 
300  //
301  // Decide if this request is waitable an allocate the IrpContext.
302  // If the file object in the stack location is NULL then this
303  // is a mount which is always waitable. Otherwise we look at
304  // the file object flags.
305  //
306 
308 
309  Wait = TRUE;
310 
311  } else {
312 
313  Wait = CanFsdWait( Irp );
314  }
315 
316  IrpContext = CdCreateIrpContext( Irp, Wait );
317 
318  //
319  // Update the thread context information.
320  //
321 
322  CdSetThreadContext( IrpContext, &ThreadContext );
323 
324 #ifdef CD_SANITY
325  NT_ASSERT( !CdTestTopLevel ||
326  SafeNodeType( IrpContext->TopLevel ) == CDFS_NTC_IRP_CONTEXT );
327 #endif
328 
329  //
330  // Otherwise cleanup the IrpContext for the retry.
331  //
332 
333  } else {
334 
335  //
336  // Set the MORE_PROCESSING flag to make sure the IrpContext
337  // isn't inadvertently deleted here. Then cleanup the
338  // IrpContext to perform the retry.
339  //
340 
341  SetFlag( IrpContext->Flags, IRP_CONTEXT_FLAG_MORE_PROCESSING );
342  CdCleanupIrpContext( IrpContext, FALSE );
343  }
344 
345  //
346  // Case on the major irp code.
347  //
348 
349  switch (IrpContext->MajorFunction) {
350 
351  case IRP_MJ_CREATE :
352 
353  Status = CdCommonCreate( IrpContext, Irp );
354  break;
355 
356  case IRP_MJ_CLOSE :
357 
358  Status = CdCommonClose( IrpContext, Irp );
359  break;
360 
361  case IRP_MJ_READ :
362 
363  //
364  // If this is an Mdl complete request, don't go through
365  // common read.
366  //
367 
368  if (FlagOn( IrpContext->MinorFunction, IRP_MN_COMPLETE )) {
369 
370  Status = CdCompleteMdl( IrpContext, Irp );
371 
372  } else {
373 
374  Status = CdCommonRead( IrpContext, Irp );
375  }
376 
377  break;
378 
379  case IRP_MJ_WRITE :
380 
381  Status = CdCommonWrite( IrpContext, Irp );
382  break;
383 
385 
386  Status = CdCommonQueryInfo( IrpContext, Irp );
387  break;
388 
390 
391  Status = CdCommonSetInfo( IrpContext, Irp );
392  break;
393 
395 
396  Status = CdCommonQueryVolInfo( IrpContext, Irp );
397  break;
398 
400 
401  Status = CdCommonDirControl( IrpContext, Irp );
402  break;
403 
405 
406  Status = CdCommonFsControl( IrpContext, Irp );
407  break;
408 
409  case IRP_MJ_DEVICE_CONTROL :
410 
411  Status = CdCommonDevControl( IrpContext, Irp );
412  break;
413 
414  case IRP_MJ_LOCK_CONTROL :
415 
416  Status = CdCommonLockControl( IrpContext, Irp );
417  break;
418 
419  case IRP_MJ_CLEANUP :
420 
421  Status = CdCommonCleanup( IrpContext, Irp );
422  break;
423 
424  case IRP_MJ_PNP :
425 
426  Status = CdCommonPnp( IrpContext, Irp );
427  break;
428 
429  case IRP_MJ_SHUTDOWN :
430 
431  Status = CdCommonShutdown( IrpContext, Irp );
432  break;
433 
434  default :
435 
437  CdCompleteRequest( IrpContext, Irp, Status );
438  }
439 
441 
442  Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
443  } _SEH2_END;
444 
445  } while (Status == STATUS_CANT_WAIT);
446 
447 #ifdef CD_SANITY
448  NT_ASSERT( !CdTestTopLevel ||
449  (PreviousTopLevel == IoGetTopLevelIrp()) );
450 #endif
451 
453 
454  NT_ASSERT( SaveIrql == KeGetCurrentIrql( ));
455 
456  return Status;
457 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
VOID CdSetThreadContext(_Inout_ PIRP_CONTEXT IrpContext, _In_ PTHREAD_CONTEXT ThreadContext)
Definition: cddata.c:981
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define IRP_MJ_SHUTDOWN
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IRP_CONTEXT_FLAG_MORE_PROCESSING
Definition: cdstruc.h:1214
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
#define SafeNodeType(Ptr)
Definition: nodetype.h:54
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_SEH2_TRY
Definition: create.c:4226
#define IRP_MN_COMPLETE
Definition: iotypes.h:4416
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
Definition: cddata.c:914
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:11
unsigned char BOOLEAN
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
Status
Definition: gdiplustypes.h:24
#define IRP_MJ_FILE_SYSTEM_CONTROL
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
#define CanFsdWait(I)
Definition: cdprocs.h:2001
NTSTATUS CdCompleteMdl(_In_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: cachesup.c:411
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
NTSTATUS CdCommonDevControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: devctrl.c:46
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
_SEH2_END
Definition: create.c:4400
LONG CdExceptionFilter(_Inout_ PIRP_CONTEXT IrpContext, _In_ PEXCEPTION_POINTERS ExceptionPointer)
Definition: cddata.c:525
#define ASSERT_OPTIONAL_IRP(I)
Definition: cddata.h:251
#define NULL
Definition: types.h:112
VOID CdCleanupIrpContext(_In_ PIRP_CONTEXT IrpContext, _In_ BOOLEAN Post)
Definition: strucsup.c:1733
NTSTATUS CdCommonLockControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: lockctrl.c:35
#define CDFS_NTC_IRP_CONTEXT
Definition: nodetype.h:34
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_CLEANUP
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
_Ret_valid_ PIRP_CONTEXT CdCreateIrpContext(_In_ PIRP Irp, _In_ BOOLEAN Wait)
Definition: strucsup.c:1573
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ DoTraceLevelMessage() [1/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_ERROR  ,
TRACINGPNP  ,
"Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was  passed,
%!STATUS!"  ,
Device  ,
status   
)

◆ DoTraceLevelMessage() [2/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_VERBOSE  ,
TRACINGDEVICE  ,
"exit WDFDEVICE %  p,
Property d,
%!STATUS!"  ,
Device  ,
DeviceProperty  ,
status   
)

◆ DoTraceLevelMessage() [3/3]

DoTraceLevelMessage ( pFxDriverGlobals  ,
TRACE_LEVEL_INFORMATION  ,
TRACINGDEVICE  ,
"WDFDEVICE %  p,
!devobj %p SetFailed %!WDF_DEVICE_FAILED_ACTION!"  ,
Device  ,
pDevice->  GetDeviceObject(),
FailedAction   
)

◆ EnqueueRequest()

return pDevice m_PkgIo EnqueueRequest ( pDevice  ,
pRequest   
)

◆ for()

for ( )

Definition at line 827 of file fxdeviceapi.cpp.

827  {
829 
830  //
831  // This check makes prefast happy
832  //
833  if (offsets[i].Offset + sizeof(WDF_TRI_STATE) > sizeof(*DeviceState)) {
834  return;
835  }
836 
838  offsets[i].Offset);
839 
840  switch (value) {
841  case WdfFalse:
842  case WdfTrue:
843  case WdfUseDefault:
844  break;
845 
846  default:
849  "WDFDEVICE 0x%p DeviceState WDF_TRI_STATE %s value out of range, "
850  "value is %d", Device, offsets[i].Name, value);
852 
853  return; // STATUS_INVALID_PARAMETER
854  }
855  }
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
enum _WDF_TRI_STATE WDF_TRI_STATE
ULONG i
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:1996
static const FxOffsetAndName offsets[]
#define TRACINGDEVICE
Definition: dbgtrace.h:58
GLsizei const GLfloat * value
Definition: glext.h:6069
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ FxObjectHandleGetPtr() [1/5]

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

Referenced by __drv_strictTypeMatch(), and if().

◆ FxObjectHandleGetPtr() [2/5]

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

◆ FxObjectHandleGetPtr() [3/5]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
String  ,
FX_TYPE_STRING  ,
(PVOID *) &  pString 
)

◆ FxObjectHandleGetPtr() [4/5]

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

◆ FxObjectHandleGetPtr() [5/5]

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
Request  ,
FX_TYPE_REQUEST  ,
(PVOID *) &  pRequest 
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  pDevice,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/15]

FxPointerNotNull ( pFxDriverGlobals  ,
Settings   
)

Referenced by if().

◆ FxPointerNotNull() [2/15]

FxPointerNotNull ( pFxDriverGlobals  ,
Key   
)

◆ FxPointerNotNull() [3/15]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceState   
)

◆ FxPointerNotNull() [4/15]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceInit   
)

◆ FxPointerNotNull() [5/15]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceInit 
)

◆ FxPointerNotNull() [6/15]

FxPointerNotNull ( pFxDriverGlobals  ,
Device   
)

◆ FxPointerNotNull() [7/15]

FxPointerNotNull ( pFxDriverGlobals  ,
SymbolicLinkName   
)

◆ FxPointerNotNull() [8/15]

FxPointerNotNull ( pFxDriverGlobals  ,
ResultLength   
)

◆ FxPointerNotNull() [9/15]

FxPointerNotNull ( pFxDriverGlobals  ,
PropertyMemory   
)

◆ FxPointerNotNull() [10/15]

FxPointerNotNull ( pFxDriverGlobals  ,
PnpCapabilities   
)

◆ FxPointerNotNull() [11/15]

FxPointerNotNull ( pFxDriverGlobals  ,
PowerCapabilities   
)

◆ FxPointerNotNull() [12/15]

FxPointerNotNull ( pFxDriverGlobals  ,
DeviceProperty   
)

◆ FxPointerNotNull() [13/15]

FxPointerNotNull ( pFxDriverGlobals  ,
RequiredSize   
)

◆ FxPointerNotNull() [14/15]

FxPointerNotNull ( pFxDriverGlobals  ,
Type   
)

◆ FxPointerNotNull() [15/15]

FxPointerNotNull ( pFxDriverGlobals  ,
EvtDeviceWdmIrpDispatch   
)

◆ FxVerifierCheckNxPoolType()

FxVerifierCheckNxPoolType ( pFxDriverGlobals  ,
PoolType  ,
pFxDriverGlobals->  Tag 
)

◆ GetAlignmentRequirement()

return deviceObject GetAlignmentRequirement ( )

◆ GetCharacteristics()

return deviceObject GetCharacteristics ( )

Referenced by DECLARE_INTERFACE_().

◆ GetDevicePnpState()

return pDevice GetDevicePnpState ( )

◆ GetDevicePowerPolicyState()

return pDevice GetDevicePowerPolicyState ( )

◆ GetDevicePowerState()

return pDevice GetDevicePowerState ( )

◆ GetDriver()

return pDevice GetDriver ( ) -> GetHandle()

◆ GetPnpState()

pDevice m_PkgPnp GetPnpState ( DeviceState  )

◆ GetSystemPowerAction()

return pDevice m_PkgPnp GetSystemPowerAction ( )

◆ if() [1/28]

if ( pTarget = NULL)

Definition at line 107 of file fxdeviceapi.cpp.

107  {
108  return pTarget->GetHandle();
109  }
FxIoTarget * pTarget
Definition: fxdeviceapi.cpp:97
WDFIOTARGET GetHandle(VOID)
Definition: fxiotarget.hpp:307

◆ if() [2/28]

if ( NT_SUCCESSstatus)

Definition at line 190 of file fxdeviceapi.cpp.

190  {
191  return status;
192  }
NTSTATUS status

◆ if() [3/28]

Definition at line 199 of file fxdeviceapi.cpp.

199  {
201  }
UNICODE_STRING m_DeviceName
Definition: fxdevice.hpp:578
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
_Must_inspect_result_ NTSTATUS Assign(__in PCWSTR SourceString)
Definition: fxstring.cpp:57
FxString * pString
Definition: ps.c:97

◆ if() [4/28]

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

Definition at line 410 of file fxdeviceapi.cpp.

410  {
412 
415  "Device 0x%p is not the power policy owner, caller cannot set S0"
416  " idle settings %!STATUS!", Device, status);
417 
418  return status;
419  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
NTSTATUS status
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [5/28]

Definition at line 424 of file fxdeviceapi.cpp.

426  {
430  "Expected Settings Size %d, got %d, %!STATUS!",
432  status);
433  return status;
434  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [6/28]

else if ( Settings->DxState< PowerDeviceD1||Settings->  DxState,
PowerDeviceMaximum||Settings->IdleCaps< IdleCannotWakeFromS0||Settings->  IdleCaps,
IdleUsbSelectiveSuspend||Settings->UserControlOfIdleSettings< IdleDoNotAllowUserControl||Settings->  UserControlOfIdleSettings,
IdleAllowUserControl||Settings->Enabled< WdfFalse||Settings->  Enabled,
WdfUseDefault   
)

Definition at line 435 of file fxdeviceapi.cpp.

442  {
443 
447  "a field (DxState, IdleCaps, Enabled, or UserControlOfIdleSettings)"
448  " is out range, %!STATUS!", status);
449  return status;
450  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [7/28]

Definition at line 456 of file fxdeviceapi.cpp.

456  {
457  if (Settings->PowerUpIdleDeviceOnSystemWake < WdfFalse ||
458  Settings->PowerUpIdleDeviceOnSystemWake > WdfUseDefault) {
459 
463  "value of field PowerUpIdleDeviceOnSystemWake is out of range,"
464  " %!STATUS!", status);
465  return status;
466  }
467  else if (Settings->IdleCaps != IdleCannotWakeFromS0 &&
468  Settings->PowerUpIdleDeviceOnSystemWake != WdfUseDefault) {
469 
473  "value of field PowerUpIdleDeviceOnSystemWake should be set only when"
474  " IdleCaps is IdleCannotWakeFromS0, %!STATUS!", status);
475  return status;
476  }
477  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [8/28]

Definition at line 482 of file fxdeviceapi.cpp.

482  {
483  if (Settings->IdleTimeoutType > SystemManagedIdleTimeoutWithHint) {
487  "WDFDEVICE %p, value of field IdleTimeoutType is out of range,"
488  " %!STATUS!", Device, status);
489  return status;
490  }
491  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
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
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [9/28]

else if ( Settings->DxState< PowerDeviceD1||Settings->  DxState,
PowerDeviceMaximum||Settings->UserControlOfWakeSettings< WakeDoNotAllowUserControl||Settings->  UserControlOfWakeSettings,
WakeAllowUserControl||Settings->Enabled< WdfFalse||Settings->  Enabled,
WdfUseDefault   
)

Definition at line 549 of file fxdeviceapi.cpp.

554  {
555 
559  "a field (DxState, Enabled, or UserControlOfIdleSettings) is out "
560  "range, %!STATUS!", status);
561  return status;
562  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [10/28]

if ( KeyName->  Length = = 0)

Definition at line 691 of file fxdeviceapi.cpp.

691  {
695  "The subkey cannot be of length zero, %!STATUS!", status);
696  return status;
697  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [11/28]

if ( pKey  = NULL)

Definition at line 713 of file fxdeviceapi.cpp.

713  {
717  "Unable to allocate memory for WDFKEY object, %!STATUS!", status);
718  return status;
719  }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [12/28]

if ( NT_SUCCESS(status )

Definition at line 724 of file fxdeviceapi.cpp.

724  {
725 
727  KeyName,
729  pKey);
730  if (NT_SUCCESS(status)) {
731  *Key = keyHandle;
732  }
733  }
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
_Must_inspect_result_ NTSTATUS OpenDevicemapKeyWorker(_In_ PFX_DRIVER_GLOBALS pFxDriverGlobals, _In_ PCUNICODE_STRING KeyName, _In_ ACCESS_MASK DesiredAccess, _In_ FxRegKey *pKey)
Definition: fxdevicekm.cpp:995
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxRegKey * pKey
PFX_DRIVER_GLOBALS pFxDriverGlobals
WDFKEY keyHandle
Definition: ps.c:97

◆ if() [13/28]

Definition at line 768 of file fxdeviceapi.cpp.

768  {
771  "WDFDEVICE 0x%p DeviceState Size %d, expected %d",
772  Device, DeviceState->Size, sizeof(WDF_DEVICE_STATE));
773 
775 
776  return; // STATUS_INFO_LENGTH_MISMATCH;
777  }
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:1996
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [14/28]

if ( *DeviceInit->CreatedDevice !  = NULL)

Definition at line 918 of file fxdeviceapi.cpp.

918  {
919  //
920  // Already created the device!
921  //
923  "WDFDEVICE 0x%p already created"
924  "STATUS_INVALID_DEVICE_STATE",
925  Device);
926 
928  }
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ if() [15/28]

if ( *DeviceInit->Security.Sddl !  = NULL || (*DeviceInit)->Security.DeviceClassSet)

Definition at line 934 of file fxdeviceapi.cpp.

934  {
935  if ((*DeviceInit)->HasName()) {
936  //
937  // Driver writer specified a name, all is good
938  //
939  DO_NOTHING();
940  }
941  else {
943 
946  "Device init: has device class or SDDL set, but does not have "
947  "a name, %!STATUS!", status);
948 
949  return status;
950  }
951  }
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:357
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define DO_NOTHING()
Definition: mxgeneral.h:32
Definition: ps.c:97

◆ if() [16/28]

if ( *DeviceInit->  RequiresSelfIoTarget)

Definition at line 953 of file fxdeviceapi.cpp.

953  {
954  if ((*DeviceInit)->InitType != FxDeviceInitTypeFdo) {
958  "Client called WdfDeviceInitAllowSelfTarget. Self "
959  "IO Targets are supported only for FDOs, %!STATUS!", status);
960  return status;
961  }
962  }
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [17/28]

Definition at line 1023 of file fxdeviceapi.cpp.

1023  {
1025 
1028  "WDFDEVICE %p already has a symbolic link associated with it, %!STATUS!",
1029  Device, status);
1030 
1031  return status;
1032  }
#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
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [18/28]

if ( BufferLength  ,
 
)

Definition at line 1092 of file fxdeviceapi.cpp.

1092  {
1094  }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4431
FxPointerNotNull(pFxDriverGlobals, Settings)
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ if() [19/28]

if ( pDevice->  IsLegacy())

Definition at line 1101 of file fxdeviceapi.cpp.

1101  {
1103 
1105  "WDFDEVICE 0x%p is not a PnP device %!STATUS!",
1106  Device, status);
1107 
1108  return status;
1109  }
#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
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [20/28]

if ( Stoppable  )

Definition at line 1242 of file fxdeviceapi.cpp.

1242  {
1243  //
1244  // Stoppable means that query stop / query remove can succeed.
1245  // This means m_DeviceStopCount == 0 (eventually if there are nested
1246  // calls to this function).
1247  //
1250  }
ULONG m_DeviceStopCount
Definition: fxpkgpnp.hpp:4146
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
#define ASSERT(a)
Definition: mode.c:45
#define InterlockedDecrement
Definition: armddk.h:52
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
signed int * PLONG
Definition: retypes.h:5

◆ if() [21/28]

if ( FailedAction< WdfDeviceFailedAttemptRestart||FailedAction WdfDeviceFailedNoRestart)

Definition at line 1281 of file fxdeviceapi.cpp.

1282  {
1285  "Invalid FailedAction %d", FailedAction);
1287  return;
1288  }
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
_In_ WDFDEVICE _In_ WDF_DEVICE_FAILED_ACTION FailedAction
Definition: wdfdevice.h:3972
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [22/28]

Definition at line 1548 of file fxdeviceapi.cpp.

1548  {
1551  "WDFDEVICE 0x%p PnpCapabilities Size %d, expected %d",
1554 
1555  return; // STATUS_INFO_LENGTH_MISMATCH;
1556  }
_In_ WDFDEVICE _In_ PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities
Definition: wdfdevice.h:3854
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [23/28]

Definition at line 1643 of file fxdeviceapi.cpp.

1643  {
1644 
1647  "WDFDEVICE 0x%p PowerCapabilities Size %d, expected %d",
1648  Device, PowerCapabilities->Size,
1650 
1652 
1653  return; // STATUS_INFO_LENGTH_MISMATCH;
1654  }
_In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
Definition: wdfdevice.h:3883
#define TRACINGDEVICE
Definition: dbgtrace.h:58
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ if() [24/28]

if ( pFxIoQueue  = NULL)

Definition at line 1946 of file fxdeviceapi.cpp.

1946  {
1948  "No default Queue configured "
1949  "for Device 0x%p", Device);
1950  return NULL;
1951  }
return NULL
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_WARNING
Definition: storswtr.h:28
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
#define TRACINGIO
Definition: dbgtrace.h:66
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ if() [25/28]

Definition at line 2171 of file fxdeviceapi.cpp.

2171  {
2174  "PropertyData size (%d) incorrect, expected %d, %!STATUS!",
2175  DeviceProperty->Size,
2176  sizeof(WDF_DEVICE_PROPERTY_DATA), status);
2177  return status;
2178  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3767
NTSTATUS status
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [26/28]

if ( BufferLength = 0 && PropertyBuffer == NULL)

Definition at line 2189 of file fxdeviceapi.cpp.

2189  {
2192  "Property buffer size is non-zero, while the buffer is NULL"
2193  ", %!STATUS!", status);
2194  return status;
2195  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [27/28]

if ( BufferLength  = = 0 && PropertyBuffer != NULL)

Definition at line 2197 of file fxdeviceapi.cpp.

2197  {
2200  "Property buffer size is zero, while the buffer is non-NULL"
2201  ", %!STATUS!", status);
2202  return status;
2203  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS status
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ if() [28/28]

if ( Driver = NULL)

Definition at line 2532 of file fxdeviceapi.cpp.

2532  {
2533  FxDriver* pDriver;
2534 
2536  Driver,
2538  (PVOID*)&pDriver);
2539 
2540  //
2541  // Find the driver's cx info if it's not the main driver for this device.
2542  // cx struct info can be NULL if cx acts as client driver.
2543  //
2545  }
FxCxDeviceInfo * pCxDeviceInfo
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
FxDriver * pDriver
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice)
FxCxDeviceInfo * GetCxDeviceInfo(__in FxDriver *CxDriver)
Definition: fxdevice.hpp:1560
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ InvalidateDeviceState()

pDevice InvalidateDeviceState ( )

◆ PowerPolicySetS0IdleSettings()

return pDevice m_PkgPnp PowerPolicySetS0IdleSettings ( Settings  )

◆ PowerPolicySetSxWakeSettings()

return pDevice m_PkgPnp PowerPolicySetSxWakeSettings ( Settings  ,
armForWakeIfChildrenAreArmedForWake  ,
indicateChildWakeOnParentWake   
)

◆ ResumeIdleWorker() [1/3]

__inline VOID ResumeIdleWorker ( __in PWDF_DRIVER_GLOBALS  DriverGlobals,
__in WDFDEVICE  Device,
__in PVOID  Tag,
__in LONG  Line,
__in PSTR  File 
)

Definition at line 1355 of file fxdeviceapi.cpp.

1367 {
1369  FxDevice *pDevice;
1370 
1372  Device,
1374  (PVOID *) &pDevice,
1375  &pFxDriverGlobals);
1376 
1380  "WdfDeviceResumeIdle does nothing if you are not the power "
1381  "policy owner for the stack");
1382  return;
1383  }
1384 
1386 }
DriverGlobals
VOID __inline PowerDereference(__in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxpkgpnp.hpp:3498
#define FALSE
Definition: types.h:117
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
#define TRACINGDEVICE
Definition: dbgtrace.h:58
Definition: ncftp.h:79
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
Definition: File.h:15
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
PFX_DRIVER_GLOBALS pFxDriverGlobals

◆ ResumeIdleWorker() [2/3]

ResumeIdleWorker ( DriverGlobals  ,
Device  ,
NULL  ,
,
NULL   
)

◆ ResumeIdleWorker() [3/3]

ResumeIdleWorker ( DriverGlobals  ,
Device  ,
Tag  ,
Line  ,
File   
)

◆ return()

return ( WDFQUEUE  ) -> GetObjectHandle()

◆ SetAlignmentRequirement()

deviceObject SetAlignmentRequirement ( AlignmentRequirement  )

◆ SetCharacteristics()

deviceObject SetCharacteristics ( DeviceCharacteristics FILE_DEVICE_SECURE_OPEN)

◆ SetDeviceBase()

pKey SetDeviceBase ( pDevice  )

◆ SetDeviceFailed()

pDevice m_PkgPnp SetDeviceFailed ( FailedAction  )

◆ SetObject() [1/2]

deviceObject SetObject ( pDevice->  GetDeviceObject())

◆ SetObject() [2/2]

deviceObject SetObject ( pDeviceBase->  GetDeviceObject())

◆ SetPnpState()

pDevice m_PkgPnp SetPnpState ( DeviceState  )

◆ StopIdleWorker()

__inline NTSTATUS StopIdleWorker ( __in PWDF_DRIVER_GLOBALS  DriverGlobals,
__in WDFDEVICE  Device,
__in BOOLEAN  WaitForD0,
__in PVOID  Tag,
__in LONG  Line,
__in PSTR  File 
)

Definition at line 1300 of file fxdeviceapi.cpp.

1314 {
1316  NTSTATUS status;
1317  FxDevice *pDevice;
1318 
1320  Device,
1322  (PVOID *) &pDevice,
1323  &pFxDriverGlobals);
1324 
1325  if (WaitForD0) {
1327  PASSIVE_LEVEL);
1328  if (!NT_SUCCESS(status)) {
1329  return status;
1330  }
1331  }
1332 
1333 
1338  "WDFDEVICE %p WdfDeviceStopIdle does nothing if you are not the power "
1339  "policy owner for the stack, %!STATUS!", Device, status);
1340  return status;
1341  }
1342 
1344 
1347  "WDFDEVICE %p WdfDeviceStopIdle, WaitForD0 %d %!STATUS!",
1348  Device, WaitForD0, status);
1349 
1350  return status;
1351 }
LONG NTSTATUS
Definition: precomp.h:26
DriverGlobals
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
#define FALSE
Definition: types.h:117
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
NTSTATUS status
FxDevice * pDevice
Definition: fxdeviceapi.cpp:71
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ NTSTATUS __inline PowerReference(__in BOOLEAN WaitForD0, __in_opt PVOID Tag=NULL, __in_opt LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxpkgpnp.hpp:3486
Definition: ncftp.h:79
BOOLEAN IsPowerPolicyOwner(VOID)
Definition: fxpkgpnp.hpp:3612
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN WaitForD0
Definition: wdfdevice.h:4003
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
FxPkgPnp * m_PkgPnp
Definition: fxdevice.hpp:670
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
Definition: File.h:15
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: ps.c:97

◆ switch()

switch ( MajorFunction  )

Definition at line 2512 of file fxdeviceapi.cpp.

2512  {
2513  case IRP_MJ_WRITE:
2514  case IRP_MJ_READ:
2515  case IRP_MJ_DEVICE_CONTROL:
2516 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
2518 #endif
2519  break;
2520  default:
2524  "Invalid MajorFunction provided %!IRPMJ!, %!STATUS!",
2526  goto exit;
2527  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
void exit(int exitcode)
Definition: _exit.c:33
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
Definition: ps.c:97

◆ VerifyWdfDeviceWdmDispatchIrpToIoQueue()

_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 
)

Definition at line 2608 of file fxdeviceapi.cpp.

2615 {
2617  UCHAR majorFunction, minorFunction;
2618  FxIrp fxIrp(Irp);
2619 
2621 
2623  minorFunction = fxIrp.GetMinorFunction();
2624 
2626  FxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIO,
2627  "WDFDEVICE 0x%p !devobj 0x%p %!IRPMJ!, IRP_MN %x, IRP 0x%p",
2628  device->GetHandle(), device->GetDeviceObject(),
2629  majorFunction, minorFunction, Irp);
2630 
2631  //
2632  // Validate Flags. For UMDF, this field is reserved and must be zero.
2633  //
2634 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
2636 #else
2638 #endif
2641  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2642  "Flags 0x%x are invalid, %!STATUS!",
2643  Flags, status);
2644  FxVerifierDbgBreakPoint(FxDriverGlobals);
2645  goto Done;
2646  }
2647 
2648  //
2649  // Only read/writes/ctrls/internal_ctrls IRPs are allowed, i.e., the I/O request set.
2650  //
2651  if (device->GetDispatchPackage(majorFunction) != device->m_PkgIo) {
2654  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2655  "Only Read/Write/Control/Internal-Control IRPs can be "
2656  "forwarded to I/O Queue 0x%p, Irp 0x%p, %!IRPMJ!, "
2657  "IRP_MN %x, Device 0x%p, %!STATUS!",
2658  queue->GetHandle(), Irp, majorFunction, minorFunction,
2659  device->GetObjectHandle(), status);
2660  FxVerifierDbgBreakPoint(FxDriverGlobals);
2661  goto Done;
2662  }
2663 
2664  //
2665  // Make sure queue can handle the request.
2666  //
2667  if (FALSE == queue->IsIoEventHandlerRegistered(
2669 
2672  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2673  "I/O Queue 0x%p cannot handle Irp 0x%p, %!IRPMJ!, "
2674  "IRP_MN %x, Device 0x%p, %!STATUS!",
2675  queue->GetHandle(), Irp, majorFunction, minorFunction,
2676  device->GetObjectHandle(), status);
2677  FxVerifierDbgBreakPoint(FxDriverGlobals);
2678  goto Done;
2679  }
2680 
2681  if (device->m_ParentDevice == queue->GetDevice()) {
2682  //
2683  // Send to parent device's queue validation.
2684  //
2685  if (device->m_ParentDevice == NULL) {
2688  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2689  "No parent device for Device 0x%p, %!STATUS!",
2690  device->GetObjectHandle(), status);
2691  FxVerifierDbgBreakPoint(FxDriverGlobals);
2692  goto Done;
2693  }
2694 
2695  //
2696  // Make sure the child device is a PDO
2697  //
2698  ASSERT(device->IsPdo());
2699 
2700  //
2701  // Check if the WdfPdoInitSetForwardRequestToParent was called to
2702  // increase the StackSize of the child Device to include the stack
2703  // size of the parent Device
2704  //
2705  if (device->IsPnp() &&
2706  device->GetPdoPkg()->m_AllowForwardRequestToParent == FALSE) {
2709  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2710  "WdfPdoInitSetForwardRequestToParent not called on "
2711  "Device 0x%p, %!STATUS!",
2712  device->GetObjectHandle(), status);
2713  FxVerifierDbgBreakPoint(FxDriverGlobals);
2714  goto Done;
2715  }
2716  }
2717  else {
2718  //
2719  // Send to current device's queue validation.
2720  //
2721  if (device != queue->GetDevice()) {
2724  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
2725  "Cannot forward a request to "
2726  "a different Device 0x%p, %!STATUS!",
2727  queue->GetDevice()->GetObjectHandle(), status);
2728  FxVerifierDbgBreakPoint(FxDriverGlobals);
2729  goto Done;
2730  }
2731  }
2732 
2733 Done:
2734  return status;
2735 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
Definition: fxirp.hpp:28
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
Definition: devices.h:37
return NULL
#define PAGED_CODE_LOCKED()
Definition: kefuncs.h:1429
Definition: _queue.h:59
NTSTATUS status
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
#define ASSERT(a)
Definition: mode.c:45
unsigned char UCHAR
Definition: xmlstorage.h:181
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGPNP, "Device name for WDFDEVICE 0x%p is NULL. Possibly incorrect " "device handle was passed, %!STATUS!", Device, status)
FxIrp fxIrp(Irp)
UCHAR majorFunction
UCHAR GetMinorFunction(VOID)
Definition: fxirpum.cpp:297
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACINGIO
Definition: dbgtrace.h:66
#define FX_DISPATCH_IRP_TO_IO_QUEUE_FLAGS_MASK
Definition: fxdevice.hpp:93
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

Variable Documentation

◆ __pad5__

exit __pad5__

Definition at line 2603 of file fxdeviceapi.cpp.

◆ AlignmentRequirement

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 301 of file fxdeviceapi.cpp.

◆ armForWakeIfChildrenAreArmedForWake

armForWakeIfChildrenAreArmedForWake
Initial value:
=
Settings->ArmForWakeIfChildrenAreArmedForWake :
struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_5 WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_5
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
#define FALSE
Definition: types.h:117

Definition at line 514 of file fxdeviceapi.cpp.

◆ BufferLength

◆ DesiredAccess

◆ Device

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 68 of file fxdeviceapi.cpp.

◆ DeviceAttributes

◆ DeviceCharacteristics

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 224 of file fxdeviceapi.cpp.

◆ deviceFlags

ULONG deviceFlags

Definition at line 2497 of file fxdeviceapi.cpp.

◆ DeviceInit

◆ DeviceInstanceKeyType

◆ deviceObject

◆ DeviceProperty

◆ DeviceState

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 754 of file fxdeviceapi.cpp.

◆ Driver

Definition at line 2450 of file fxdeviceapi.cpp.

◆ DriverContext

◆ else

else
Initial value:
{
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
Definition: ps.c:97

Definition at line 202 of file fxdeviceapi.cpp.

◆ EvtDeviceWdmIrpDispatch

_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ WDFDRIVER _In_ UCHAR _In_ PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDispatch

Definition at line 2450 of file fxdeviceapi.cpp.

Referenced by FxPkgIo::ConfigureDynamicDispatching().

◆ FailedAction

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1269 of file fxdeviceapi.cpp.

◆ File

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1435 of file fxdeviceapi.cpp.

◆ i

ULONG i

Definition at line 798 of file fxdeviceapi.cpp.

◆ indicateChildWakeOnParentWake

indicateChildWakeOnParentWake
Initial value:
=
Settings->IndicateChildWakeOnParentWake :
struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_5 WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_5
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
#define FALSE
Definition: types.h:117

Definition at line 515 of file fxdeviceapi.cpp.

◆ Key

* Key
Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 610 of file fxdeviceapi.cpp.

◆ KeyAttributes

◆ keyHandle

WDFKEY keyHandle

Definition at line 674 of file fxdeviceapi.cpp.

Referenced by FxDevice::_OpenKey(), and if().

◆ KeyName

◆ Line

Definition at line 1425 of file fxdeviceapi.cpp.

◆ MajorFunction

Definition at line 2450 of file fxdeviceapi.cpp.

◆ NULL

return NULL

◆ offsets

static const FxOffsetAndName offsets
static
Initial value:

Definition at line 800 of file fxdeviceapi.cpp.

◆ pCxDeviceInfo

pCxDeviceInfo = NULL

Definition at line 2496 of file fxdeviceapi.cpp.

Referenced by if().

◆ pDevice

pDevice = NULL

Definition at line 71 of file fxdeviceapi.cpp.

Referenced by __drv_strictTypeMatch(), if(), ResumeIdleWorker(), and StopIdleWorker().

◆ pDeviceBase

FxDeviceBase* pDeviceBase

Definition at line 98 of file fxdeviceapi.cpp.

◆ pdoName

FxAutoString pdoName

Definition at line 991 of file fxdeviceapi.cpp.

Referenced by FxDevice::CreateSymbolicLink().

◆ pFxDevice

FxDevice* pFxDevice

Definition at line 1924 of file fxdeviceapi.cpp.

◆ pFxDriverGlobals

◆ pFxIoQueue

pFxIoQueue = NULL

Definition at line 1923 of file fxdeviceapi.cpp.

Referenced by __drv_strictTypeMatch().

◆ pKey

◆ PnpCapabilities

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1521 of file fxdeviceapi.cpp.

◆ PoolType

◆ PowerCapabilities

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1619 of file fxdeviceapi.cpp.

◆ pPkgIo

pPkgIo = NULL

Definition at line 1923 of file fxdeviceapi.cpp.

Referenced by FxPkgGeneral::OnCleanup().

◆ pRequest

FxRequest* pRequest

Definition at line 2001 of file fxdeviceapi.cpp.

◆ PropertyBuffer

◆ PropertyMemory

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1166 of file fxdeviceapi.cpp.

◆ PropertyMemoryAttributes

◆ pString

◆ pTarget

◆ Queue

_Must_inspect_result_ __in WDFDEVICE __in WDFQUEUE Queue

Definition at line 1769 of file fxdeviceapi.cpp.

◆ Request

_Must_inspect_result_ __in WDFDEVICE __in WDFREQUEST Request
Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1996 of file fxdeviceapi.cpp.

◆ RequiredSize

◆ ResultLength

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1078 of file fxdeviceapi.cpp.

◆ return

return

Definition at line 1255 of file fxdeviceapi.cpp.

◆ Settings

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 395 of file fxdeviceapi.cpp.

◆ status

◆ Stoppable

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1232 of file fxdeviceapi.cpp.

◆ String

_Must_inspect_result_ __in WDFDEVICE __in WDFSTRING String
Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 175 of file fxdeviceapi.cpp.

◆ SymbolicLinkName

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 987 of file fxdeviceapi.cpp.

◆ Tag

__in WDFDEVICE __in_opt PVOID Tag

Definition at line 1425 of file fxdeviceapi.cpp.

◆ Type

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 2153 of file fxdeviceapi.cpp.

◆ WaitForD0

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 1401 of file fxdeviceapi.cpp.