• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PoStartNextPowerIrp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PoStartNextPowerIrp函数的典型用法代码示例。如果您正苦于以下问题:C++ PoStartNextPowerIrp函数的具体用法?C++ PoStartNextPowerIrp怎么用?C++ PoStartNextPowerIrp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PoStartNextPowerIrp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
    }
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:34,代码来源:VBoxUsbPwr.cpp


示例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;
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:60,代码来源:mobipwr.c


示例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;
    }
}
开发者ID:GYGit,项目名称:reactos,代码行数:25,代码来源:usbstor.c


示例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;
}
开发者ID:Cyborg11,项目名称:PPJoy,代码行数:54,代码来源:Power.c


示例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;
}
开发者ID:OpenXT,项目名称:xc-windows,代码行数:53,代码来源:pdo.c


示例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;
}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:50,代码来源:misc_irp.c


示例7: PoStartNextPowerIrp

FORCEINLINE
VOID
FxIrp::StartNextPowerIrp(
    )
{
    PoStartNextPowerIrp(m_Irp);
}
开发者ID:AntejaVM,项目名称:WDF,代码行数:7,代码来源:fxirpkm.hpp


示例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;
}
开发者ID:Asazeus,项目名称:TuneSDRcom,代码行数:29,代码来源:power.c


示例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;
}
开发者ID:Cyborg11,项目名称:PPJoy,代码行数:32,代码来源:PPJoyBus.c


示例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...
}
开发者ID:kcrazy,项目名称:winekit,代码行数:60,代码来源:power.c


示例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 );
}
开发者ID:MasashiWada,项目名称:Xbox360-Controller-Driver,代码行数:37,代码来源:common.c


示例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()
开发者ID:GYGit,项目名称:reactos,代码行数:45,代码来源:power.c


示例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;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:34,代码来源:VBoxUsbPwr.cpp


示例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;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:33,代码来源:VBoxUsbPwr.cpp


示例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;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:28,代码来源:VBoxUsbPwr.cpp


示例16: PciPassIrpFromFdoToPdo

NTSTATUS
NTAPI
PciPassIrpFromFdoToPdo(IN PPCI_FDO_EXTENSION DeviceExtension,
                       IN PIRP Irp)
{
    PIO_STACK_LOCATION IoStackLocation;
    NTSTATUS Status;
    DPRINT1("Pci PassIrp ...\n");

    /* Get the stack location to check which function this is */
    IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
    if (IoStackLocation->MajorFunction == IRP_MJ_POWER)
    {
        /* Power IRPs are special since we have to notify the Power Manager */
        IoCopyCurrentIrpStackLocationToNext(Irp);
        PoStartNextPowerIrp(Irp);
        Status = PoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
    }
    else
    {
        /* For a normal IRP, just call the next driver in the stack */
        IoSkipCurrentIrpStackLocation(Irp);
        Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
    }

    /* Return the status back to the caller */
    return Status;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:28,代码来源:dispatch.c


示例17: HidUmdfPowerPassThrough

NTSTATUS
HidUmdfPowerPassThrough(
    _In_ PDEVICE_OBJECT DeviceObject,
    _Inout_ PIRP Irp
    )
/*++

Routine Description:

    Pass through routine for power IRPs .

Arguments:

   DeviceObject - pointer to a device object.

   Irp - pointer to an I/O Request Packet.

Return Value:

      NT status code

--*/
{
    PoStartNextPowerIrp(Irp);
    IoCopyCurrentIrpStackLocationToNext(Irp);
    return PoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
}
开发者ID:Realhram,项目名称:wdk81,代码行数:27,代码来源:hidumdf.c


示例18: PwrCompletionFunction

VOID
CALLBACK
PwrCompletionFunction(
    IN PDEVICE_OBJECT DeviceObject,
    IN UCHAR MinorFunction,
    IN POWER_STATE PowerState,
    IN PVOID Context,
    IN PIO_STATUS_BLOCK IoStatus)
{
    NTSTATUS Status;
    PQUERY_POWER_CONTEXT PwrContext = (PQUERY_POWER_CONTEXT)Context;

    if (NT_SUCCESS(IoStatus->Status))
    {
        // forward request to lower device object
        Status = PcForwardIrpSynchronous(PwrContext->DeviceObject, PwrContext->Irp);
    }
    else
    {
        // failed
        Status = IoStatus->Status;
    }

    // start next power irp
    PoStartNextPowerIrp(PwrContext->Irp);

    // complete request
    PwrContext->Irp->IoStatus.Status = Status;
    IoCompleteRequest(PwrContext->Irp, IO_NO_INCREMENT);

    // free context
    FreeItem(PwrContext, TAG_PORTCLASS);
}
开发者ID:RareHare,项目名称:reactos,代码行数:33,代码来源:irp.cpp


示例19: vboxUsbPwrIoRequestDev

static NTSTATUS vboxUsbPwrIoRequestDev(IN PVBOXUSBDEV_EXT pDevExt, IN PIRP pIrp)
{
    PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
    POWER_STATE PwrState;
    PwrState.SystemState = pSl->Parameters.Power.State.SystemState;
    PwrState.DeviceState = pDevExt->DdiState.DevCaps.DeviceState[PwrState.SystemState];

    NTSTATUS Status = STATUS_INSUFFICIENT_RESOURCES;
    PVBOXUSB_PWRDEV_CTX pDevCtx = (PVBOXUSB_PWRDEV_CTX)vboxUsbMemAlloc(sizeof (*pDevCtx));
    Assert(pDevCtx);
    if (pDevCtx)
    {
        pDevCtx->pDevExt = pDevExt;
        pDevCtx->pIrp = pIrp;

        Status = PoRequestPowerIrp(pDevExt->pPDO, pSl->MinorFunction, PwrState,
                        vboxUsbPwrIoDeviceCompletion, pDevCtx, NULL);
        Assert(NT_SUCCESS(Status));
        if (NT_SUCCESS(Status))
        {
            return STATUS_MORE_PROCESSING_REQUIRED;
        }

        vboxUsbMemFree(pDevCtx);
    }

    PoStartNextPowerIrp(pIrp);
    pIrp->IoStatus.Status = Status;
    pIrp->IoStatus.Information = 0;
    vboxUsbDdiStateRelease(pDevExt);

    /* the "real" Status is stored in pIrp->IoStatus.Status,
     * return success here to complete the Io */
    return STATUS_SUCCESS;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:35,代码来源:VBoxUsbPwr.cpp


示例20: DispatchPower

//========================================================================================
// Function:	DispatchPower
// Purpose:		This routine is the dispatch routine for power irps.
//				Does nothing except forwarding the IRP to the next device in the stack.
// Return Value:
//				NT status code
//========================================================================================
NTSTATUS
DispatchPower(
	IN PDEVICE_OBJECT	fido,			// fido - Pointer to the device object.
	IN PIRP				irp				// Irp - Pointer to the request packet.
	)
{
	PDEVICE_EXTENSION dx;
	NTSTATUS ntStatus;

	dx = (PDEVICE_EXTENSION)fido->DeviceExtension;

	PoStartNextPowerIrp(irp);

	//acquire remove lock
	ntStatus=IoAcquireRemoveLock(&dx->rmLock, irp);
	if (!NT_SUCCESS(ntStatus))
	{
		//complete irp if cannot acquire remove lock
		irp->IoStatus.Status=ntStatus;
		irp->IoStatus.Information=0;
		IoCompleteRequest(irp, IO_NO_INCREMENT);
		return ntStatus;
	}

	IoSkipCurrentIrpStackLocation(irp);
	ntStatus = PoCallDriver(dx->lowerdo, irp);

	IoReleaseRemoveLock(&dx->rmLock, irp);
	return ntStatus;
}
开发者ID:allanchen1971,项目名称:20150830_BarCo_SMBIOS,代码行数:37,代码来源:PciBusFilter.c



注:本文中的PoStartNextPowerIrp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PodZero函数代码示例发布时间:2022-05-30
下一篇:
C++ Pnt3f函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap