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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bulkpwr.c

?? 這是ARM9開發板上自帶的USB驅動程序
?? 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女一区二区在线观看| 日韩精品一级中文字幕精品视频免费观看| 狠狠色狠狠色综合| 日韩天堂在线观看| 黑人巨大精品欧美一区| 精品国产1区二区| 国产黄人亚洲片| 国产精品的网站| 欧美变态tickling挠脚心| 激情文学综合插| 国产清纯在线一区二区www| 成人动漫一区二区| 亚洲免费观看高清完整版在线观看熊| 色先锋久久av资源部| 亚洲二区视频在线| 精品欧美久久久| 99国产精品视频免费观看| 亚洲欧美电影院| 91精品啪在线观看国产60岁| 精品在线一区二区| 国产精品久久久久9999吃药| 在线看国产一区| 久久精品国产澳门| 国产精品视频yy9299一区| 欧美午夜电影网| 国内精品伊人久久久久av影院 | 成人一区二区三区在线观看 | 亚洲码国产岛国毛片在线| 欧美日韩在线电影| 国产一区二区免费在线| 一区二区三区高清在线| 日韩一区二区三区免费看 | 91视频在线看| 免费成人性网站| 国产精品国产三级国产有无不卡 | 美女视频黄 久久| 日本一区二区三区四区在线视频| 在线看一区二区| 国产综合色产在线精品| 一区二区三区精品在线| 精品999在线播放| 在线看日本不卡| 成人免费看视频| 免费成人美女在线观看.| 国产精品国产三级国产| 欧美刺激午夜性久久久久久久| 99在线精品一区二区三区| 免费成人结看片| 亚洲图片自拍偷拍| 国产精品人成在线观看免费| 日韩一区二区三区在线| 91成人在线观看喷潮| 成人午夜av影视| 久久精品国产秦先生| 午夜a成v人精品| 亚洲另类一区二区| 国产欧美日产一区| 久久综合资源网| 91精品综合久久久久久| 91浏览器在线视频| 成人激情小说网站| 国产精品1024| 国产一区在线看| 精品一区二区影视| 日韩国产在线观看| 亚洲高清视频中文字幕| 黄色小说综合网站| 久久福利视频一区二区| 天天做天天摸天天爽国产一区| 亚洲免费在线观看| 亚洲天堂2016| 中文字幕在线观看不卡| 中文字幕av一区二区三区免费看| 精品捆绑美女sm三区| 日韩一区二区三区在线视频| 欧美剧情片在线观看| 欧美日韩在线综合| 欧美午夜片在线观看| 在线看一区二区| 欧美色窝79yyyycom| 欧美日韩一区视频| 欧美剧在线免费观看网站| 欧美精品亚洲二区| 欧美一区二区三区免费视频 | 韩国精品在线观看| 国产精品中文欧美| 国产成人啪免费观看软件| 国产老肥熟一区二区三区| 国产精品99久久久久久久女警| 激情综合色综合久久| 国产久卡久卡久卡久卡视频精品| 国产一区二区中文字幕| 国产成人av电影在线| 成人免费高清视频| 99国产精品久久久久久久久久久| 色哟哟一区二区| 欧美色手机在线观看| 7777精品伊人久久久大香线蕉完整版 | 国产日韩在线不卡| 国产精品每日更新| 一区二区三区在线观看网站| 亚洲va中文字幕| 久久精品国产一区二区| 成人免费毛片app| 欧美午夜一区二区三区免费大片| 这里只有精品免费| 国产亚洲精品aa| 亚洲欧美电影院| 奇米影视在线99精品| 国产成人亚洲精品狼色在线| 99精品偷自拍| 在线91免费看| 中文乱码免费一区二区| 一区二区三区国产精华| 激情综合五月婷婷| 成人动漫一区二区在线| 国产精品美女久久久久aⅴ国产馆| 欧美成人vr18sexvr| 亚洲国产精品一区二区www在线| 亚洲卡通欧美制服中文| 午夜国产精品一区| av一区二区三区黑人| 欧美一区二区三区思思人| 国产欧美精品在线观看| 婷婷中文字幕一区三区| 成人深夜视频在线观看| 91精品国产综合久久久蜜臀图片 | 欧美久久久久久久久中文字幕| 久久av中文字幕片| 波多野结衣91| 欧美剧在线免费观看网站| 国产精品久久久久久久久快鸭 | 日韩三级伦理片妻子的秘密按摩| 国产精品久久久久桃色tv| 日韩电影免费在线看| 99久久国产免费看| 久久美女艺术照精彩视频福利播放| 亚洲人被黑人高潮完整版| 韩国欧美国产一区| 欧美日韩精品一区二区三区| 中文字幕亚洲一区二区av在线| 久久国产麻豆精品| 欧美性一二三区| 亚洲欧洲精品天堂一级| 国产原创一区二区三区| 337p亚洲精品色噜噜噜| 亚洲一区二区三区四区不卡| caoporn国产精品| 国产午夜精品一区二区三区视频 | 日本不卡在线视频| 在线观看av一区| 国产精品乱码人人做人人爱 | 国产成人精品免费看| 日韩一区二区三区四区| 午夜精品成人在线视频| 一本大道久久精品懂色aⅴ| 国产精品热久久久久夜色精品三区| 精品一区二区三区视频在线观看| 欧美日韩专区在线| 一级日本不卡的影视| 91看片淫黄大片一级在线观看| 日本一区二区免费在线观看视频| 国产精品一区二区你懂的| 久久免费看少妇高潮| 国产伦精品一区二区三区在线观看 | 免费在线看一区| 91精品福利在线一区二区三区 | 美女国产一区二区三区| 51精品国自产在线| 日韩精品欧美精品| 91麻豆精品国产91久久久使用方法 | 亚洲国产精品成人久久综合一区| 韩国成人福利片在线播放| 日韩美女主播在线视频一区二区三区| 婷婷一区二区三区| 欧美丰满高潮xxxx喷水动漫| 午夜欧美视频在线观看| 678五月天丁香亚洲综合网| 午夜精品国产更新| 日韩精品一区国产麻豆| 国产精品一区二区男女羞羞无遮挡 | 91亚洲永久精品| 亚洲精品视频免费观看| 精品婷婷伊人一区三区三| 天堂资源在线中文精品| 欧美一级搡bbbb搡bbbb| 狠狠v欧美v日韩v亚洲ⅴ| 国产欧美日产一区| 91免费看片在线观看| 亚洲国产精品影院| 精品日韩在线一区| 成人午夜大片免费观看| 一区二区三区成人在线视频| 91精品国产91久久久久久最新毛片 | 国产不卡在线一区| 亚洲日本成人在线观看| 日韩三级在线观看| 国产不卡在线一区| 亚洲高清免费在线| 久久久久久久久久久久久久久99|