29 DPRINT(
"PortClsCreate called\n");
44 IResourceList* resource_list =
NULL;
58 DPRINT(
"IRP_MN_START_DEVICE\n");
81 resource_list->Release();
95 DPRINT(
"StartDevice returned a failure code [0x%8x]\n",
Status);
118 DPRINT(
"IRP_MN_REMOVE_DEVICE\n");
139 DPRINT(
"IRP_MN_QUERY_INTERFACE\n");
143 DPRINT(
"IRP_MN_QUERY_DEVICE_RELATIONS\n");
147 DPRINT(
"IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
151 DPRINT(
"IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
155 DPRINT(
"IRP_MN_READ_CONFIG\n");
212 DPRINT(
"PortClsPower called\n");
371 DPRINT(
"PortClsSysControl called\n");
376 Irp->IoStatus.Information = 0;
389 DPRINT(
"PortClsShutdown called\n");
401 Irp->IoStatus.Information = 0;
450 Irp->IoStatus.Information = 0;
489#undef IoSetCompletionRoutine
490#define IoSetCompletionRoutine(_Irp, \
491 _CompletionRoutine, \
497 PIO_STACK_LOCATION _IrpSp; \
498 _IrpSp = IoGetNextIrpStackLocation(_Irp); \
499 _IrpSp->CompletionRoutine = (PIO_COMPLETION_ROUTINE)(_CompletionRoutine); \
500 _IrpSp->Context = (_Context); \
501 _IrpSp->Control = 0; \
502 if (_InvokeOnSuccess) _IrpSp->Control = SL_INVOKE_ON_SUCCESS; \
503 if (_InvokeOnError) _IrpSp->Control |= SL_INVOKE_ON_ERROR; \
504 if (_InvokeOnCancel) _IrpSp->Control |= SL_INVOKE_ON_CANCEL; \
525 if (
Irp->CurrentLocation <
Irp->StackCount + 1)
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define NT_SUCCESS(StatCode)
KSDDKAPI NTSTATUS NTAPI KsDispatchIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
struct QUERY_POWER_CONTEXT * PQUERY_POWER_CONTEXT
NTSTATUS NTAPI PortClsPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
NTSTATUS NTAPI PcDispatchIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI PcForwardIrpSynchronous(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI PortClsShutdown(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI PortClsPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI PortClsCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI PcCompleteIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN NTSTATUS Status)
VOID CALLBACK PwrCompletionFunction(IN PDEVICE_OBJECT DeviceObject, IN UCHAR MinorFunction, IN POWER_STATE PowerState, IN PVOID Context, IN PIO_STATUS_BLOCK IoStatus)
NTSTATUS NTAPI PortClsSysControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
VOID FreeItem(IN PVOID Item)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define IoSkipCurrentIrpStackLocation(Irp)
#define IoCopyCurrentIrpStackLocationToNext(Irp)
#define IoCompleteRequest
POWER_STATE NTAPI PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, IN POWER_STATE_TYPE Type, IN POWER_STATE State)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
NTSTATUS NTAPI PoRequestPowerIrp(_In_ PDEVICE_OBJECT DeviceObject, _In_ UCHAR MinorFunction, _In_ POWER_STATE PowerState, _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction, _In_opt_ __drv_aliasesMem PVOID Context, _Outptr_opt_ PIRP *pIrp)
#define PC_ASSERT_IRQL_EQUAL(x)
struct PCLASS_DEVICE_EXTENSION * PPCLASS_DEVICE_EXTENSION
#define IRP_MJ_DEVICE_CONTROL
PORTCLASSAPI NTSTATUS NTAPI PcNewResourceList(OUT PRESOURCELIST *OutResourceList, IN PUNKNOWN OuterUnknown OPTIONAL, IN POOL_TYPE PoolType, IN PCM_RESOURCE_LIST TranslatedResourceList, IN PCM_RESOURCE_LIST UntranslatedResourceList)
#define STATUS_MORE_PROCESSING_REQUIRED
IResourceList * resources
PDEVICE_OBJECT PhysicalDeviceObject
PDEVICE_OBJECT PrevDeviceObject
IAdapterPowerManagement * AdapterPowerManagement
SYSTEM_POWER_STATE SystemPowerState
PCPFNSTARTDEVICE StartDevice
DEVICE_POWER_STATE DevicePowerState
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@3983::@4019 Power
union _IO_STACK_LOCATION::@1584 Parameters
struct _IO_STACK_LOCATION::@3983::@4020 StartDevice
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
_In_ UCHAR _In_ UCHAR MinorFunction
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
#define IRP_MN_QUERY_INTERFACE
#define IRP_MN_START_DEVICE
#define IRP_MN_READ_CONFIG
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MJ_SYSTEM_CONTROL
_In_ SYSTEM_POWER_STATE SystemPowerState
#define IRP_MN_QUERY_POWER