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

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

?? bulkpwr.c

?? 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一区二区三区免费野_久草精品视频
激情亚洲综合在线| 欧美人动与zoxxxx乱| 欧美日韩亚洲高清一区二区| 精品国内二区三区| 亚洲人123区| 国产精品一二三四区| 欧美日韩国产在线播放网站| 国产精品福利一区| 国产精品一区二区无线| 91精品黄色片免费大全| 日韩理论电影院| 国产二区国产一区在线观看| 欧美精品vⅰdeose4hd| 自拍偷拍国产亚洲| 国产精品亚洲午夜一区二区三区| 欧美一区二区啪啪| 亚洲国产精品久久不卡毛片 | 日韩精品成人一区二区在线| 丰满白嫩尤物一区二区| 日韩精品一区二区三区四区| 日韩极品在线观看| 欧美午夜不卡在线观看免费| 亚洲精品乱码久久久久久黑人| 国产精品99久久久久| 日韩免费观看高清完整版| 五月天中文字幕一区二区| 在线免费精品视频| 一区二区三区在线观看国产| 99久久久久久| 亚洲美女偷拍久久| 在线观看日产精品| 五月婷婷久久综合| 日韩女优av电影| 国产资源精品在线观看| 久久精品一区二区三区不卡| 激情综合网最新| 精品av久久707| 国产一区二区三区在线观看免费| 日韩精品在线一区二区| 国产精品影视天天线| 国产校园另类小说区| 国产精品正在播放| 国产精品乱人伦一区二区| 色又黄又爽网站www久久| 亚欧色一区w666天堂| 欧美一级艳片视频免费观看| 韩国女主播成人在线| 中文字幕欧美三区| 777色狠狠一区二区三区| 琪琪久久久久日韩精品| 久久网站热最新地址| av成人动漫在线观看| 亚洲午夜一区二区| 日韩一区二区三区电影在线观看| 国产一区二区久久| 亚洲综合色婷婷| 日韩限制级电影在线观看| 国产一区二区三区四| |精品福利一区二区三区| 欧美视频完全免费看| 国内久久精品视频| 一区二区高清免费观看影视大全 | 美女在线一区二区| 欧美激情一区二区三区在线| 色琪琪一区二区三区亚洲区| 久久国产人妖系列| 亚洲人妖av一区二区| 欧美一区二区三区免费大片 | 国产精品私房写真福利视频| 欧美午夜一区二区三区免费大片| 久久99国产精品免费| 亚洲同性同志一二三专区| 日韩欧美区一区二| 色婷婷久久久亚洲一区二区三区| 日韩1区2区日韩1区2区| 国产精品伦理在线| 精品国产乱码久久| 欧美熟乱第一页| 懂色av一区二区在线播放| 午夜精品久久久久久久久久 | 欧美日韩一区二区在线观看视频 | 99re在线视频这里只有精品| 久久精品国产色蜜蜜麻豆| 亚洲精选免费视频| 欧美精品一区二区三区高清aⅴ| 日本丰满少妇一区二区三区| 国产成人精品一区二区三区四区 | 石原莉奈在线亚洲三区| 国产精品亲子伦对白| 2020国产成人综合网| 91精品蜜臀在线一区尤物| 成人精品国产一区二区4080| 麻豆91免费观看| 亚洲第四色夜色| 亚洲免费av观看| 中文一区二区在线观看| 26uuu国产在线精品一区二区| 欧美色图免费看| 欧美视频你懂的| 日本高清不卡一区| 在线一区二区三区四区| 91年精品国产| 91麻豆自制传媒国产之光| 成人免费观看av| 国产成都精品91一区二区三| 国内精品久久久久影院色| 久久成人精品无人区| 美美哒免费高清在线观看视频一区二区 | 日韩伦理av电影| 国产精品久久久久久久久久免费看| 久久久久久免费| 国产亚洲午夜高清国产拍精品 | 欧美一区二区三区性视频| 7878成人国产在线观看| 777午夜精品视频在线播放| 欧美一区二区三区日韩视频| 欧美一区二区三区视频免费 | 在线亚洲精品福利网址导航| 91麻豆福利精品推荐| 日本高清不卡视频| 欧美性受极品xxxx喷水| 欧美精品乱码久久久久久按摩| 欧美乱妇20p| 亚洲精品在线电影| 国产日产欧美一区二区视频| 国产精品女主播av| 一区二区三区在线观看视频| 五月天一区二区| 蜜臀精品久久久久久蜜臀| 国内精品国产成人国产三级粉色| 国产毛片一区二区| 色综合色狠狠综合色| 欧美区在线观看| 久久久久99精品国产片| 中文字幕一区二区三区av| 亚洲第一激情av| 国产美女视频一区| 99精品国产一区二区三区不卡| 欧美午夜精品久久久久久超碰 | 激情欧美一区二区| 99久久99久久精品国产片果冻| 欧美亚洲动漫精品| 26uuu国产电影一区二区| 亚洲精品免费播放| 美女mm1313爽爽久久久蜜臀| av在线播放一区二区三区| 欧美人狂配大交3d怪物一区 | 精品国产亚洲在线| 综合av第一页| 久久99深爱久久99精品| 99视频一区二区| 日韩欧美一区中文| 亚洲啪啪综合av一区二区三区| 麻豆国产精品官网| 91国在线观看| 久久久不卡网国产精品一区| 亚洲一卡二卡三卡四卡五卡| 国产精品91一区二区| 欧美色大人视频| 国产精品三级电影| 日本午夜一本久久久综合| 一道本成人在线| 久久老女人爱爱| 日产国产高清一区二区三区| 99久久婷婷国产精品综合| 2020国产精品久久精品美国| 午夜激情久久久| 在线亚洲精品福利网址导航| 日本一区二区三区高清不卡| 免费在线观看一区二区三区| 色婷婷国产精品| 国产欧美精品区一区二区三区| 免费观看一级特黄欧美大片| 欧美三级日韩三级国产三级| 中文字幕亚洲视频| 成人免费的视频| 久久网站热最新地址| 久久成人羞羞网站| 日韩一区国产二区欧美三区| 亚洲gay无套男同| 在线观看日韩精品| 亚洲综合激情另类小说区| 91丨porny丨最新| 国产精品久久网站| 成人免费av资源| 欧美韩日一区二区三区| 国产精品羞羞答答xxdd| 久久久五月婷婷| 激情欧美一区二区| 精品国产电影一区二区| 久久99久久久欧美国产| 欧美一级一区二区| 蜜桃久久久久久| 欧美成人精品二区三区99精品| 日本中文字幕一区二区视频| 欧美日韩dvd在线观看| 视频在线在亚洲| 欧美精品免费视频| 久久99日本精品| 国产亚洲成av人在线观看导航 |