本文整理汇总了C++中PoStartNextPowerIrp函数的典型用法代码示例。如果您正苦于以下问题:C++ PoStartNextPowerIrp函数的具体用法?C++ PoStartNextPowerIrp怎么用?C++ PoStartNextPowerIrp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PoStartNextPowerIrp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DECLHIDDEN
DECLHIDDEN(NTSTATUS) vboxUsbDispatchPower(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp)
{
PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pDeviceObject->DeviceExtension;
ENMVBOXUSB_PNPSTATE enmState = vboxUsbDdiStateRetainIfNotRemoved(pDevExt);
switch (enmState)
{
case ENMVBOXUSB_PNPSTATE_REMOVED:
{
PoStartNextPowerIrp(pIrp);
pIrp->IoStatus.Status = STATUS_DELETE_PENDING;
pIrp->IoStatus.Information = 0;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
vboxUsbDdiStateRelease(pDevExt);
return STATUS_DELETE_PENDING;
}
case ENMVBOXUSB_PNPSTATE_START_PENDING:
{
PoStartNextPowerIrp(pIrp);
IoSkipCurrentIrpStackLocation(pIrp);
vboxUsbDdiStateRelease(pDevExt);
return PoCallDriver(pDevExt->pLowerDO, pIrp);
}
default:
{
return vboxUsbPwrDispatch(pDevExt, pIrp);
}
}
}
示例2: WaitWakeCompletionRoutine
NTSTATUS
WaitWakeCompletionRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PDEVICE_EXTENSION DeviceExtension
)
/*++
Routine Description:
This is the IoSet completion routine for the wait wake irp.
Arguments:
DeviceObject - pointer to device object
Irp - I/O request packet
DeviceExtension - pointer to device extension
Return Value:
NT status value
--*/
{
MobiUsb_DbgPrint(3, ("file mobipwr: WaitWakeCompletionRoutine - begins\n"));
if(Irp->PendingReturned) {
IoMarkIrpPending(Irp);
}
//
// Nullify the WaitWakeIrp pointer-the Irp is released
// as part of the completion process. If it's already NULL,
// avoid race with the CancelWaitWake routine.
//
if(InterlockedExchangePointer(&DeviceExtension->WaitWakeIrp, NULL)) {
PoStartNextPowerIrp(Irp);
return STATUS_SUCCESS;
}
//
// CancelWaitWake has run.
// If FlagWWCancel != 0, complete the Irp.
// If FlagWWCancel == 0, CancelWaitWake completes it.
//
if(InterlockedExchange(&DeviceExtension->FlagWWCancel, 1)) {
PoStartNextPowerIrp(Irp);
return STATUS_CANCELLED;
}
MobiUsb_DbgPrint(3, ("file mobipwr: WaitWakeCompletionRoutine - ends\n"));
return STATUS_MORE_PROCESSING_REQUIRED;
}
示例3: USBSTOR_DispatchPower
NTSTATUS
NTAPI
USBSTOR_DispatchPower(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PFDO_DEVICE_EXTENSION DeviceExtension;
// get common device extension
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
if (DeviceExtension->Common.IsFDO)
{
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
}
else
{
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
}
示例4: PPJoy_Power
NTSTATUS PPJoy_Power (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
PDEVICE_EXTENSION DeviceExtension;
NTSTATUS ntStatus;
POWER_STATE PowerState;
POWER_STATE_TYPE PowerType;
PIO_STACK_LOCATION Stack;
PAGED_CODE ();
PPJOY_DBGPRINT (FILE_POWER | PPJOY_FENTRY, ("Enter PPJoy_Power(DeviceObject=0x%p,Irp=0x%p)",DeviceObject,Irp) );
DeviceExtension = GET_MINIDRIVER_DEVICE_EXTENSION (DeviceObject);
ntStatus= PPJoy_EnterRequest (DeviceExtension);
if (NT_SUCCESS(ntStatus))
{
Stack= IoGetCurrentIrpStackLocation (Irp);
PowerType= Stack->Parameters.Power.Type;
PowerState= Stack->Parameters.Power.State;
if ((Stack->MinorFunction==IRP_MN_SET_POWER)&&
(PowerType==DevicePowerState)&&
(PowerState.DeviceState==PowerDeviceD0))
{
PPJOY_DBGPRINT (FILE_POWER|PPJOY_BABBLE, ("We got a device D0 power state request for our device. Set parallel port mode again") );
/* Set the parallel port mode. */
PPJoy_InitPortAndInterface (DeviceObject);
}
/* Must be called before IoSkipCurrentIrpStackLocation, else bugcheck */
PoStartNextPowerIrp (Irp);
/* Prepare IRP stack for next driver */
IoSkipCurrentIrpStackLocation (Irp);
/* We call PoCallDriver since this is a Power IRP */
ntStatus= PoCallDriver (GET_NEXT_DEVICE_OBJECT (DeviceObject),Irp);
}
else
{
/* Must be called even when the device is removed */
PoStartNextPowerIrp (Irp);
Irp->IoStatus.Information= 0;
Irp->IoStatus.Status= ntStatus;
IoCompleteRequest (Irp,IO_NO_INCREMENT);
}
PPJoy_LeaveRequest (DeviceExtension);
PPJOY_EXITPROC (FILE_POWER|PPJOY_FEXIT, "PPJOY_Power",ntStatus);
return ntStatus;
}
示例5: XenM2BPdoPower
NTSTATUS
XenM2BPdoPower(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
{
PXENM2B_PDO_EXTENSION pPdoExt = (PXENM2B_PDO_EXTENSION)pDeviceObject->DeviceExtension;
PIO_STACK_LOCATION pIrpStack;
POWER_STATE PowerState;
POWER_STATE_TYPE PowerType;
NTSTATUS Status = STATUS_SUCCESS;
pIrpStack = IoGetCurrentIrpStackLocation(pIrp);
PowerType = pIrpStack->Parameters.Power.Type;
PowerState = pIrpStack->Parameters.Power.State;
switch (pIrpStack->MinorFunction) {
case IRP_MN_SET_POWER:
TraceDebug(("%s: IRP_MN_SET_POWER\n", __FUNCTION__));
if (PowerType == DevicePowerState) {
TraceDebug(("%s: IRP_MN_SET_POWER DevicePowerState:%x\n", __FUNCTION__, PowerState.DeviceState));
PoSetPowerState(pPdoExt->pDevice, DevicePowerState, PowerState);
pPdoExt->DevicePowerState = PowerState.DeviceState;
}
else if (PowerType == SystemPowerState) {
TraceDebug(("%s: IRP_MN_SET_POWER SystemPowerState:%x\n", __FUNCTION__, PowerState.SystemState));
pPdoExt->SystemPowerState = PowerState.SystemState;
}
PoStartNextPowerIrp(pIrp);
pIrp->IoStatus.Status = Status;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
break;
case IRP_MN_QUERY_POWER:
TraceDebug(("%s: IRP_MN_QUERY_POWER\n", __FUNCTION__));
PoStartNextPowerIrp(pIrp);
pIrp->IoStatus.Status = Status;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
break;
case IRP_MN_WAIT_WAKE:
case IRP_MN_POWER_SEQUENCE:
default:
PoStartNextPowerIrp(pIrp);
Status = pIrp->IoStatus.Status;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
break;
}
return Status;
}
示例6: dc_process_power_irp
static
NTSTATUS dc_process_power_irp(dev_hook *hook, PIRP irp)
{
NTSTATUS status;
PIO_STACK_LOCATION irp_sp;
int no_pass = 0;
irp_sp = IoGetCurrentIrpStackLocation(irp);
if ( (irp_sp->MinorFunction == IRP_MN_SET_POWER) &&
(irp_sp->Parameters.Power.Type == SystemPowerState) )
{
wait_object_infinity(&hook->busy_lock);
if (irp_sp->Parameters.Power.State.SystemState == PowerSystemHibernate)
{
/* prevent device encryption to sync device and memory state */
hook->flags |= F_PREVENT_ENC;
dc_send_sync_packet(hook->dev_name, S_OP_SYNC, 0);
}
if (irp_sp->Parameters.Power.State.SystemState == PowerSystemWorking) {
/* allow encryption requests */
hook->flags &= ~F_PREVENT_ENC;
}
KeReleaseMutex(&hook->busy_lock, FALSE);
}
if ( (irp_sp->MinorFunction == IRP_MN_QUERY_POWER) &&
(irp_sp->Parameters.Power.Type == SystemPowerState) &&
(irp_sp->Parameters.Power.State.SystemState == PowerSystemHibernate) )
{
if ( (dc_is_vista_or_later == 0) && (dump_is_pverent_hibernate() != 0) ) {
PoStartNextPowerIrp(irp);
status = dc_complete_irp(irp, STATUS_UNSUCCESSFUL, 0);
no_pass = 1;
}
}
if (no_pass == 0) {
PoStartNextPowerIrp(irp);
IoSkipCurrentIrpStackLocation(irp);
status = PoCallDriver(hook->orig_dev, irp);
}
IoReleaseRemoveLock(&hook->remv_lock, irp);
return status;
}
示例7: PoStartNextPowerIrp
FORCEINLINE
VOID
FxIrp::StartNextPowerIrp(
)
{
PoStartNextPowerIrp(m_Irp);
}
示例8: c0cPowerDispatch
NTSTATUS c0cPowerDispatch(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
NTSTATUS status;
PC0C_COMMON_EXTENSION pDevExt = pDevObj->DeviceExtension;
HALT_UNLESS2(IoGetCurrentIrpStackLocation(pIrp)->MajorFunction == IRP_MJ_POWER,
IoGetCurrentIrpStackLocation(pIrp)->MajorFunction,
IoGetCurrentIrpStackLocation(pIrp)->MinorFunction);
TraceIrp("POWER", pIrp, NULL, TRACE_FLAG_PARAMS);
switch (pDevExt->doType) {
case C0C_DOTYPE_FB:
case C0C_DOTYPE_FP:
PoStartNextPowerIrp(pIrp);
IoSkipCurrentIrpStackLocation(pIrp);
status = PoCallDriver(((PC0C_COMMON_FDO_EXTENSION)pDevExt)->pLowDevObj, pIrp);
break;
case C0C_DOTYPE_PP:
status = PdoPortPower((PC0C_PDOPORT_EXTENSION)pDevExt, pIrp);
break;
default:
status = STATUS_NO_SUCH_DEVICE;
pIrp->IoStatus.Status = status;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
}
return status;
}
示例9: PPJoyBus_Power
NTSTATUS PPJoyBus_Power (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
NTSTATUS ntStatus;
PCOMMON_DATA CommonData;
PAGED_CODE ();
PPJOY_DBGPRINT (FILE_PPJOYBUS|PPJOY_FENTRY, ("PPJoyBus_Power(DeviceObject=0x%p,Irp=0x%p)",DeviceObject,Irp) );
CommonData= DeviceObject->DeviceExtension;
ntStatus= PPJoyBus_EnterRequest(CommonData);
if (!NT_SUCCESS(ntStatus))
{
/* Must always call PoStartNextPowerIrp()!!! */
PoStartNextPowerIrp (Irp);
/* Set status in IRP and complete the request */
Irp->IoStatus.Status= ntStatus;
IoCompleteRequest (Irp,IO_NO_INCREMENT);
goto Exit;
}
if (CommonData->Flags&PPJFLAGS_ISBUSDEV)
ntStatus= PPJoyBus_Power_Bus (DeviceObject,Irp);
else
ntStatus= PPJoyBus_Power_Joy (DeviceObject,Irp);
Exit:
PPJoyBus_LeaveRequest(CommonData);
PPJOY_EXITPROC (FILE_PPJOYBUS|PPJOY_FEXIT_STATUSOK, "PPJoyBus_Power",ntStatus);
return ntStatus;
}
示例10: Serenum_FDOPowerComplete
NTSTATUS
Serenum_FDOPowerComplete (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp,
IN PVOID Context)
/*++
--*/
{
POWER_STATE powerState;
POWER_STATE_TYPE powerType;
PIO_STACK_LOCATION stack;
PFDO_DEVICE_DATA data;
UNREFERENCED_PARAMETER(Context);
if (Irp->PendingReturned) {
IoMarkIrpPending(Irp);
}
data = (PFDO_DEVICE_DATA)DeviceObject->DeviceExtension;
stack = IoGetCurrentIrpStackLocation(Irp);
powerType = stack->Parameters.Power.Type;
powerState = stack->Parameters.Power.State;
switch (stack->MinorFunction) {
case IRP_MN_SET_POWER:
switch (powerType) {
case DevicePowerState:
//
// Powering Up
//
ASSERT(powerState.DeviceState < data->DeviceState);
data->DeviceState = powerState.DeviceState;
PoSetPowerState(data->Self, powerType, powerState);
break;
default:
break;
}
break;
case IRP_MN_QUERY_POWER:
ASSERT(IRP_MN_QUERY_POWER != stack->MinorFunction);
break;
default:
//
// Basically, this is ASSERT(0)
//
ASSERT(0xBADBAD == IRP_MN_QUERY_POWER);
break;
}
PoStartNextPowerIrp(Irp);
Serenum_DecIoCount(data);
return STATUS_SUCCESS; // Continue completion...
}
示例11: SendAndWaitPowerRequest
//----------------------------------------------------------------------------------------------
// SendAndWaitPowerRequest
//----------------------------------------------------------------------------------------------
NTSTATUS SendAndWaitPowerRequest(
IN PDEVICE_OBJECT DeviceObject
,IN PIRP Irp )
{
// 変数宣言
NTSTATUS Status;
KEVENT WaitEvent;
// 下位ドライバに I/O 要求を発行する
KeInitializeEvent( &WaitEvent, NotificationEvent, FALSE );
PoStartNextPowerIrp( Irp );
IoCopyCurrentIrpStackLocationToNext( Irp );
IoSetCompletionRoutine(
Irp
,(PIO_COMPLETION_ROUTINE)IoCompletionRoutine
,(PVOID)&WaitEvent
,TRUE
,TRUE
,TRUE );
#if (NTDDI_VERSION < NTDDI_LONGHORN)
Status = PoCallDriver( GET_NEXT_DEVICE_OBJECT( DeviceObject ), Irp );
#else
Status = IoCallDriver( GET_NEXT_DEVICE_OBJECT( DeviceObject ), Irp );
#endif
// 下位ドライバの処理が完了するまで待機する
if( Status == STATUS_PENDING )
{
KeWaitForSingleObject( &WaitEvent, Executive, KernelMode, FALSE, NULL );
Status = Irp->IoStatus.Status;
}
return( Status );
}
示例12: ClassDispatchPower
/*++////////////////////////////////////////////////////////////////////////////
ClassDispatchPower()
Routine Description:
This routine acquires the removelock for the irp and then calls the
appropriate power callback.
Arguments:
DeviceObject -
Irp -
Return Value:
--*/
NTSTATUS
NTAPI
ClassDispatchPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension;
ULONG isRemoved;
//
// NOTE: This code may be called at PASSIVE or DISPATCH, depending
// upon the device object it is being called for.
// don't do anything that would break under either circumstance.
//
isRemoved = ClassAcquireRemoveLock(DeviceObject, Irp);
if(isRemoved) {
ClassReleaseRemoveLock(DeviceObject, Irp);
Irp->IoStatus.Status = STATUS_DEVICE_DOES_NOT_EXIST;
PoStartNextPowerIrp(Irp);
ClassCompleteRequest(DeviceObject, Irp, IO_NO_INCREMENT);
return STATUS_DEVICE_DOES_NOT_EXIST;
}
return commonExtension->DevInfo->ClassPowerDevice(DeviceObject, Irp);
} // end ClassDispatchPower()
示例13: vboxUsbPwrSetPowerDev
static NTSTATUS vboxUsbPwrSetPowerDev(IN PVBOXUSBDEV_EXT pDevExt, IN PIRP pIrp)
{
PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
DEVICE_POWER_STATE enmDevPState = pSl->Parameters.Power.State.DeviceState;
DEVICE_POWER_STATE enmCurDevPState = pDevExt->DdiState.PwrState.PowerState.DeviceState;
NTSTATUS Status = STATUS_SUCCESS;
if (enmDevPState > enmCurDevPState && enmCurDevPState == PowerDeviceD0)
{
Status = vboxUsbPwrIoWaitCompletionAndPostAsync(pDevExt, pIrp);
Assert(NT_SUCCESS(Status));
if (NT_SUCCESS(Status))
return Status;
}
PoStartNextPowerIrp(pIrp);
if (NT_SUCCESS(Status))
{
IoCopyCurrentIrpStackLocationToNext(pIrp);
IoSetCompletionRoutine(pIrp, vboxUsbPwrIoPostDevCompletion, pDevExt, TRUE, TRUE, TRUE);
Status = PoCallDriver(pDevExt->pLowerDO, pIrp);
}
else
{
pIrp->IoStatus.Status = Status;
pIrp->IoStatus.Information = 0;
IoCompleteRequest(pIrp, IO_NO_INCREMENT);
vboxUsbDdiStateRelease(pDevExt);
}
return Status;
}
示例14: vboxUsbPwrIoPostDevCompletion
static NTSTATUS vboxUsbPwrIoPostDevCompletion(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp, IN PVOID pvContext)
{
PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pvContext;
if (pIrp->PendingReturned)
{
IoMarkIrpPending(pIrp);
}
NTSTATUS Status = pIrp->IoStatus.Status;
Assert(Status == STATUS_SUCCESS);
if (NT_SUCCESS(Status))
{
PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
switch (pSl->MinorFunction)
{
case IRP_MN_SET_POWER:
{
pDevExt->DdiState.PwrState.PowerState.DeviceState = pSl->Parameters.Power.State.DeviceState;
PoSetPowerState(pDevExt->pFDO, DevicePowerState, pSl->Parameters.Power.State);
break;
}
default:
{
break;
}
}
}
PoStartNextPowerIrp(pIrp);
vboxUsbDdiStateRelease(pDevExt);
return STATUS_SUCCESS;
}
示例15: vboxUsbPwrIoPostSysCompletion
static NTSTATUS vboxUsbPwrIoPostSysCompletion(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp, IN PVOID pvContext)
{
PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pvContext;
NTSTATUS Status = pIrp->IoStatus.Status;
Assert(Status == STATUS_SUCCESS);
if (NT_SUCCESS(Status))
{
PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
switch (pSl->MinorFunction)
{
case IRP_MN_SET_POWER:
{
pDevExt->DdiState.PwrState.PowerState.SystemState = pSl->Parameters.Power.State.SystemState;
break;
}
default:
{
break;
}
}
return vboxUsbPwrIoRequestDev(pDevExt, pIrp);
}
PoStartNextPowerIrp(pIrp);
vboxUsbDdiStateRelease(pDevExt);
return STATUS_SUCCESS;
}