亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bulkpwr.c

?? smdk2410 wince 4 bsp
?? C
?? 第 1 頁 / 共 3 頁
字號:
                                Irp);


        BulkUsb_DecrementIoCount(DeviceObject);

        break; /* IRP_MN_QUERY_POWER */

    default:

        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_ProcessPowerIrp() UNKNOWN POWER MESSAGE (%x)\n", irpStack->MinorFunction));

        //
        // All unhandled power messages are passed on to the PDO
        //

        IoCopyCurrentIrpStackLocationToNext(Irp);
        PoStartNextPowerIrp(Irp);
        ntStatus = PoCallDriver(deviceExtension->TopOfStackDeviceObject, Irp);

        BulkUsb_DecrementIoCount(DeviceObject);

    } /* irpStack->MinorFunction */

    BULKUSB_KdPrint( DBGLVL_MEDIUM,  ( "Exit BulkUsb_ProcessPowerIrp()  ntStatus = 0x%x\n", ntStatus ) );
    return ntStatus;
}


NTSTATUS
BulkUsb_PoRequestCompletion(
    IN PDEVICE_OBJECT       DeviceObject,
    IN UCHAR                MinorFunction,
    IN POWER_STATE          PowerState,
    IN PVOID                Context,
    IN PIO_STATUS_BLOCK     IoStatus
    )
/*++

Routine Description:

        This is the completion routine set in a call to PoRequestPowerIrp()
        that was made in BulkUsb_ProcessPowerIrp() in response to receiving
    an IRP_MN_SET_POWER of type 'SystemPowerState' when the device was
        not in a compatible device power state. In this case, a pointer to
        the IRP_MN_SET_POWER Irp is saved into the FDO device extension
        (deviceExtension->PowerIrp), and then a call must be
        made to PoRequestPowerIrp() to put the device into a proper power state,
        and this routine is set as the completion routine.

    We decrement our pending io count and pass the saved IRP_MN_SET_POWER Irp
        on to the next driver

Arguments:

    DeviceObject - Pointer to the device object for the class device.
        Note that we must get our own device object from the Context

    Context - Driver defined context, in this case our own functional device object ( FDO )

Return Value:

    The function value is the final status from the operation.

--*/
{
    PIRP irp;
    PDEVICE_EXTENSION deviceExtension;
    PDEVICE_OBJECT deviceObject = Context;
    NTSTATUS ntStatus;

    deviceExtension = deviceObject->DeviceExtension;

        // Get the Irp we saved for later processing in BulkUsb_ProcessPowerIrp()
        // when we decided to request the Power Irp that this routine
        // is the completion routine for.
    irp = deviceExtension->PowerIrp;

        // We will return the status set by the PDO for the power request we're completing
    ntStatus = IoStatus->Status;

    BULKUSB_KdPrint( DBGLVL_HIGH,("Enter BulkUsb_PoRequestCompletion()\n"));

    // we should not be in the midst of handling a self-generated power irp
    BULKUSB_ASSERT( !deviceExtension->SelfPowerIrp );

    // we must pass down to the next driver in the stack
    IoCopyCurrentIrpStackLocationToNext(irp);

    // Calling PoStartNextPowerIrp() indicates that the driver is finished
    // with the previous power IRP, if any, and is ready to handle the next power IRP.
    // It must be called for every power IRP.Although power IRPs are completed only once,
    // typically by the lowest-level driver for a device, PoStartNextPowerIrp must be called
    // for every stack location. Drivers must call PoStartNextPowerIrp while the current IRP
    // stack location points to the current driver. Therefore, this routine must be called
    // before IoCompleteRequest, IoSkipCurrentStackLocation, and PoCallDriver.

    PoStartNextPowerIrp(irp);

    // PoCallDriver is used to pass any power IRPs to the PDO instead of IoCallDriver.
    // When passing a power IRP down to a lower-level driver, the caller should use
    // IoSkipCurrentIrpStackLocation or IoCopyCurrentIrpStackLocationToNext to copy the IRP to
    // the next stack location, then call PoCallDriver. Use IoCopyCurrentIrpStackLocationToNext
    // if processing the IRP requires setting a completion routine, or IoSkipCurrentStackLocation
    // if no completion routine is needed.

    PoCallDriver(deviceExtension->TopOfStackDeviceObject,
                 irp);

    BulkUsb_DecrementIoCount(deviceObject);

    BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_PoRequestCompletion() Exit IRP_MN_SET_POWER\n"));

    deviceExtension->PowerIrp = NULL;

    return ntStatus;
}




NTSTATUS
BulkUsb_PowerIrp_Complete(
    IN PDEVICE_OBJECT NullDeviceObject,
    IN PIRP Irp,
    IN PVOID Context
    )
/*++

Routine Description:

    This routine is called when An IRP_MN_SET_POWER of type 'DevicePowerState'
    has been received by BulkUsb_ProcessPowerIrp(), and that routine has  determined
        1) the request is for full powerup ( to PowerDeviceD0 ), and
        2) We are not already in that state
    A call is then made to PoRequestPowerIrp() with this routine set as the completion routine.


Arguments:

    DeviceObject - Pointer to the device object for the class device.

    Irp - Irp completed.

    Context - Driver defined context.

Return Value:

    The function value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PDEVICE_OBJECT deviceObject;
    PIO_STACK_LOCATION irpStack;
    PDEVICE_EXTENSION deviceExtension;

    BULKUSB_KdPrint( DBGLVL_HIGH,("enter BulkUsb_PowerIrp_Complete\n"));

    deviceObject = (PDEVICE_OBJECT) Context;

    deviceExtension = (PDEVICE_EXTENSION) deviceObject->DeviceExtension;

    //  If the lower driver returned PENDING, mark our stack location as pending also.
    if (Irp->PendingReturned) {
        IoMarkIrpPending(Irp);
    }

    irpStack = IoGetCurrentIrpStackLocation (Irp);

    // We can assert that we're a  device powerup-to D0 request,
    // because that was the only type of request we set a completion routine
    // for in the first place
    BULKUSB_ASSERT(irpStack->MajorFunction == IRP_MJ_POWER);
    BULKUSB_ASSERT(irpStack->MinorFunction == IRP_MN_SET_POWER);
    BULKUSB_ASSERT(irpStack->Parameters.Power.Type==DevicePowerState);
    BULKUSB_ASSERT(irpStack->Parameters.Power.State.DeviceState==PowerDeviceD0);

    // Now that we know we've let the lower drivers do what was needed to power up,
    //  we can set our device extension flags accordingly
    deviceExtension->CurrentDevicePowerState = PowerDeviceD0;

    Irp->IoStatus.Status = ntStatus;

    BulkUsb_DecrementIoCount(deviceObject);

    BULKUSB_KdPrint( DBGLVL_MEDIUM,("exit BulkUsb_PowerIrp_Complete Exit IRP_MN_SET_POWER D0 complete\n"));
    return ntStatus;
}



NTSTATUS
BulkUsb_SelfSuspendOrActivate(
    IN PDEVICE_OBJECT DeviceObject,
    IN BOOLEAN fSuspend
    )
/*++

Routine Description:

        Called on BulkUsb_PnPAddDevice() to power down until needed (i.e., till a pipe is actually opened).
        Called on BulkUsb_Create() to power up device to D0 before opening 1st pipe.
        Called on BulkUsb_Close() to power down device if this is the last pipe.

Arguments:

    DeviceObject - Pointer to the device object

    fSuspend; TRUE to Suspend, FALSE to acivate.


Return Value:

    If the operation is not attemtped, SUCCESS is returned.
    If the operation is attemtped, the value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;

    POWER_STATE PowerState;
    PDEVICE_EXTENSION deviceExtension;


    deviceExtension = DeviceObject->DeviceExtension;
    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Enter BulkUsb_SelfSuspendOrActivate(),fSuspend = %d\n", fSuspend));


        // Can't accept request if:
    //  1) device is removed,
    //  2) has never been started,
    //  3) is stopped,
    //  4) has a remove request pending,
    //  5) has a stop device pending
    if ( !BulkUsb_CanAcceptIoRequests( DeviceObject ) ) {
        ntStatus = STATUS_DELETE_PENDING;

                BULKUSB_KdPrint( DBGLVL_MEDIUM,("ABORTING BulkUsb_SelfSuspendOrActivate()\n"));
        return ntStatus;
    }


    // don't do anything if any System-generated Device Pnp irps are pending
    if ( NULL != deviceExtension->PowerIrp ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing on pending deviceExtension->PowerIrp 0x%x\n", deviceExtension->PowerIrp));
        return ntStatus;
    }

    // don't do anything if any self-generated Device Pnp irps are pending
    if ( deviceExtension->SelfPowerIrp ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing on pending deviceExtension->SelfPowerIrp\n" ));
        return ntStatus;
    }

    // don't auto-suspend if any pipes are open
    if ( fSuspend && ( 0 != deviceExtension->OpenPipeCount ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing to self-suspend on OpenPipeCount %d\n", deviceExtension->OpenPipeCount));
        return ntStatus;
    }

    // don't auto-activate if no pipes are open
    if ( !fSuspend && ( 0 == deviceExtension->OpenPipeCount ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing to self-activate, no pipes open\n"));
        return ntStatus;
    }

    // dont do anything if registry CurrentControlSet\Services\BulkUsb\Parameters\PowerDownLevel
    //  has been set to  zero, PowerDeviceD0 ( 1 ), or a bogus high value
    if ( ( deviceExtension->PowerDownLevel == PowerDeviceD0 ) ||
         ( deviceExtension->PowerDownLevel == PowerDeviceUnspecified)  ||
         ( deviceExtension->PowerDownLevel >= PowerDeviceMaximum ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(), refusing on deviceExtension->PowerDownLevel == %d\n", deviceExtension->PowerDownLevel));
        return ntStatus;
    }

    if ( fSuspend )
        PowerState.DeviceState = deviceExtension->PowerDownLevel;
    else
        PowerState.DeviceState = PowerDeviceD0;  // power up all the way; we're probably just about to do some IO

    ntStatus = BulkUsb_SelfRequestPowerIrp( DeviceObject, PowerState );

    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_SelfSuspendOrActivate() status 0x%x on setting dev state %s\n", ntStatus, BULKUSB_StringForDevState(PowerState.DeviceState ) ));

    return ntStatus;

}


NTSTATUS
BulkUsb_SelfRequestPowerIrp(
    IN PDEVICE_OBJECT DeviceObject,
    IN POWER_STATE PowerState
    )
/*++

Routine Description:

    This routine is called by BulkUsb_SelfSuspendOrActivate() to
    actually make the system request for a powerdown/up to PowerState.
    It first checks to see if we are already in Powerstate and immediately
    returns  SUCCESS with no further processing if so


Arguments:

    DeviceObject - Pointer to the device object

    PowerState. power state requested, e.g PowerDeviceD0.


Return Value:

    The function value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PDEVICE_EXTENSION deviceExtension;
    PIRP pIrp = NULL;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线播放三区四区| 国产精品12区| 91国内精品野花午夜精品| 亚洲视频香蕉人妖| 欧美亚洲尤物久久| 亚洲综合免费观看高清完整版在线| 91视频你懂的| 亚洲国产wwwccc36天堂| 欧美福利电影网| 狠狠色丁香婷婷综合| 欧美国产乱子伦 | 国产精品国产馆在线真实露脸| 成人动漫一区二区三区| 亚洲精品日韩一| 日韩视频免费直播| www.视频一区| 亚洲一二三四区不卡| 欧美一三区三区四区免费在线看| 国产一区二区伦理片| 国产精品久久午夜夜伦鲁鲁| 欧美色视频一区| 久久电影网电视剧免费观看| 中文字幕亚洲在| 欧美日韩精品一区二区三区蜜桃| 精品无人区卡一卡二卡三乱码免费卡| 久久久九九九九| 欧美亚洲一区三区| 国产一区二区三区精品视频| 亚洲美女区一区| 精品处破学生在线二十三| www.一区二区| 久久国产免费看| 亚洲欧洲成人精品av97| 欧美一区二区视频在线观看| 国产a级毛片一区| 亚洲成人激情社区| 国产精品入口麻豆九色| 欧美电影影音先锋| 成人18精品视频| 免费欧美在线视频| 亚洲日本va午夜在线电影| 日韩亚洲欧美综合| 色综合天天综合给合国产| 激情六月婷婷久久| 亚洲一二三区在线观看| 国产欧美日韩在线| 日韩免费视频线观看| 欧美伊人久久久久久久久影院| 国产精品18久久久久| 日韩在线观看一区二区| 亚洲免费电影在线| 国产欧美综合色| 精品久久久三级丝袜| 欧美精品1区2区3区| 91久久精品网| 成人综合婷婷国产精品久久蜜臀| 日本麻豆一区二区三区视频| 亚洲精品伦理在线| 中文字幕亚洲综合久久菠萝蜜| 亚洲欧美色综合| www日韩大片| 欧美精品xxxxbbbb| 一本大道综合伊人精品热热 | 国产亚洲欧美日韩俺去了| 欧美老肥妇做.爰bbww| 91啦中文在线观看| 成人a区在线观看| 成人免费视频国产在线观看| 国产一区二区在线观看免费| 免费成人结看片| 日韩一区精品字幕| 日日摸夜夜添夜夜添精品视频| 亚洲精品国产一区二区三区四区在线| 国产日产欧美一区二区三区| 久久一区二区三区四区| 久久久久久电影| 欧美精品一区二区三区四区| 欧美成人vps| 精品国产sm最大网站| 日韩亚洲欧美中文三级| 欧美一区二区人人喊爽| 欧美一区二区三区免费大片 | 国产精品麻豆欧美日韩ww| 欧美国产亚洲另类动漫| 国产人久久人人人人爽| 国产欧美综合在线| 亚洲色图色小说| 亚洲综合一区二区三区| 亚洲高清免费观看 | 欧美视频一区二| 欧美日韩国产综合久久| 精品1区2区3区| 精品视频免费在线| 欧美一级二级三级乱码| 精品国产a毛片| 亚洲国产精品高清| 亚洲乱码国产乱码精品精98午夜| 一区二区三区在线观看视频| 亚洲成人你懂的| 久草这里只有精品视频| 国产1区2区3区精品美女| 成人午夜精品在线| 一本一道综合狠狠老| 欧美美女一区二区在线观看| 欧美本精品男人aⅴ天堂| 久久久久国产一区二区三区四区| 国产精品国产三级国产有无不卡| 洋洋成人永久网站入口| 麻豆精品在线观看| 国产suv精品一区二区三区| 在线精品视频小说1| 3atv一区二区三区| 欧美国产欧美综合| 五月激情六月综合| 成人精品国产免费网站| 欧美亚洲一区三区| 久久久久青草大香线综合精品| ...中文天堂在线一区| 丝袜诱惑亚洲看片 | 丰满放荡岳乱妇91ww| 一本到三区不卡视频| 8v天堂国产在线一区二区| 久久精品男人天堂av| 亚洲午夜精品17c| 国产一区二区三区国产| 欧美三级视频在线| 日本一区二区电影| 蜜桃视频在线观看一区| 色狠狠色噜噜噜综合网| 精品黑人一区二区三区久久| 亚洲精品午夜久久久| 国产精品一区2区| 欧美日韩国产影片| 中文字幕亚洲在| 国产在线精品免费av| 欧美性受xxxx黑人xyx性爽| 国产亚洲精品aa午夜观看| 天天影视涩香欲综合网| 9久草视频在线视频精品| 日韩欧美区一区二| 亚洲一区二区在线免费观看视频| 高清免费成人av| 欧美一区三区二区| 亚洲资源中文字幕| www.亚洲在线| 欧美经典三级视频一区二区三区| 久久精品国产精品亚洲精品| 欧美日韩中文精品| 亚洲精品伦理在线| 91在线码无精品| 国产欧美一区二区精品秋霞影院| 精品一区二区免费视频| 91精品国产综合久久福利软件| 尤物视频一区二区| 色综合久久久久综合体| 中文字幕一区二区三区四区| 丰满少妇在线播放bd日韩电影| 久久久久久久久久久久久久久99 | 久热成人在线视频| 欧美精品久久99久久在免费线 | 综合亚洲深深色噜噜狠狠网站| 国产一区二区三区免费看| 欧美大白屁股肥臀xxxxxx| 日韩**一区毛片| 欧美日韩国产另类不卡| 亚洲一区欧美一区| 欧美日韩国产高清一区| 水蜜桃久久夜色精品一区的特点| 欧美天堂一区二区三区| 亚洲成人午夜电影| 欧美精品v日韩精品v韩国精品v| 亚洲aaa精品| 欧美区在线观看| 午夜成人在线视频| 欧美二区三区91| 蓝色福利精品导航| 久久九九国产精品| 成人白浆超碰人人人人| 亚洲美女一区二区三区| 欧美性大战久久久久久久| 亚洲国产wwwccc36天堂| 欧美一二三在线| 激情综合五月天| 国产天堂亚洲国产碰碰| www.综合网.com| 亚洲综合999| 日韩亚洲欧美在线| 国产精品综合一区二区三区| 国产精品美女久久久久aⅴ国产馆| 99国内精品久久| 亚洲一区二区三区不卡国产欧美 | 免费不卡在线视频| 久久久亚洲欧洲日产国码αv| 成人免费视频app| 亚洲日本一区二区三区| 91精品国产欧美一区二区18| 国产一区二区三区在线观看精品 | 午夜精品视频一区| 精品奇米国产一区二区三区| 丰满放荡岳乱妇91ww|