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

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

?? bulkpwr.c

?? smdk2410 wince 4 bsp
?? C
?? 第 1 頁 / 共 3 頁
字號:
    deviceExtension =  DeviceObject->DeviceExtension;

    // This should have been reset in completion routine
    BULKUSB_ASSERT( !deviceExtension->SelfPowerIrp );

    if (  deviceExtension->CurrentDevicePowerState ==  PowerState.DeviceState )
        return STATUS_SUCCESS;  // nothing to do

    BULKUSB_KdPrint( DBGLVL_HIGH,("Enter BulkUsb_SelfRequestPowerIrp() will request power irp to state %s\n",
        BULKUSB_StringForDevState( PowerState.DeviceState )));

    BulkUsb_IncrementIoCount(DeviceObject);

        // flag we're handling a self-generated power irp
    deviceExtension->SelfPowerIrp = TRUE;

        // actually request the Irp
    ntStatus = PoRequestPowerIrp(deviceExtension->PhysicalDeviceObject,
                         IRP_MN_SET_POWER,
                         PowerState,
                         BulkUsb_PoSelfRequestCompletion,
                         DeviceObject,
                         NULL);


    if  ( ntStatus == STATUS_PENDING ) {
        // status pending is the return code we wanted

        // We only need to wait for completion if we're powering up
        if ( (ULONG) PowerState.DeviceState < deviceExtension->PowerDownLevel ) {

            NTSTATUS waitStatus;

            waitStatus = KeWaitForSingleObject(
                           &deviceExtension->SelfRequestedPowerIrpEvent,
                           Suspended,
                           KernelMode,
                           FALSE,
                           NULL);

        }

        ntStatus = STATUS_SUCCESS;

        deviceExtension->SelfPowerIrp = FALSE;

        BULKUSB_KdPrint( DBGLVL_HIGH, ("BulkUsb_SelfRequestPowerIrp() SUCCESS\n    IRP 0x%x to state %s\n",
            pIrp, BULKUSB_StringForDevState(PowerState.DeviceState) ));


    }
    else {
        // The return status was not STATUS_PENDING; any other codes must be considered in error here;
        //  i.e., it is not possible to get a STATUS_SUCCESS  or any other non-error return from this call;
        BULKUSB_KdPrint( DBGLVL_HIGH, ("BulkUsb_SelfRequestPowerIrp() to state %s FAILED, status = 0x%x\n",
            BULKUSB_StringForDevState( PowerState.DeviceState ),ntStatus));
    }

    return ntStatus;
}



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

Routine Description:

    This routine is called when the driver completes a self-originated power IRP
        that was generated by a call to BulkUsb_SelfSuspendOrActivate().
    We power down whenever the last pipe is closed and power up when the first pipe is opened.

    For power-up , we set an event in our FDO extension to signal this IRP done
    so the power request can be treated as a synchronous call.
    We need to know the device is powered up before opening the first pipe, for example.
    For power-down, we do not set the event, as no caller waits for powerdown complete.

Arguments:

    DeviceObject - Pointer to the device object for the class device. ( Physical Device Object )

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

Return Value:

    The function value is the final status from the operation.

--*/
{
    PDEVICE_OBJECT deviceObject = Context;
    PDEVICE_EXTENSION deviceExtension = deviceObject->DeviceExtension;
    NTSTATUS ntStatus = IoStatus->Status;

    // we should not be in the midst of handling a system-generated power irp
    BULKUSB_ASSERT( NULL == deviceExtension->PowerIrp );

    // We only need to set the event if we're powering up;
    // No caller waits on power down complete
    if ( (ULONG) PowerState.DeviceState < deviceExtension->PowerDownLevel ) {

        // Trigger Self-requested power irp completed event;
        //  The caller is waiting for completion
        KeSetEvent(&deviceExtension->SelfRequestedPowerIrpEvent, 1, FALSE);
    }

    BulkUsb_DecrementIoCount(deviceObject);

    BULKUSB_KdPrintCond( DBGLVL_HIGH, !NT_SUCCESS(ntStatus),("Exit BulkUsb_PoSelfRequestCompletion() FAILED, ntStatus = 0x%x\n", ntStatus ));

    return ntStatus;
}


BOOLEAN
BulkUsb_SetDevicePowerState(
    IN PDEVICE_OBJECT DeviceObject,
    IN DEVICE_POWER_STATE DeviceState
    )
/*++

Routine Description:

    This routine is called when An IRP_MN_SET_POWER of type 'DevicePowerState'
    has been received by BulkUsb_ProcessPowerIrp().


Arguments:

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

    DeviceState - Device specific power state to set the device in to.


Return Value:

    For requests to DeviceState D0 ( fully on ), returns TRUE to signal caller
    that we must set a completion routine and finish there.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PDEVICE_EXTENSION deviceExtension;
    BOOLEAN fRes = FALSE;

    deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

    switch (DeviceState) {
    case PowerDeviceD3:

        //
        // Device will be going OFF,
                // TODO: add any needed device-dependent code to save state here.
                //  ( We have nothing to do in this sample )
        //

        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_SetDevicePowerState() PowerDeviceD3 (OFF)\n"));

        deviceExtension->CurrentDevicePowerState = DeviceState;
        break;

    case PowerDeviceD1:
    case PowerDeviceD2:
        //
        // power states D1,D2 translate to USB suspend

        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_SetDevicePowerState()  %s\n",
            BULKUSB_StringForDevState(DeviceState) ));

        deviceExtension->CurrentDevicePowerState = DeviceState;
        break;

    case PowerDeviceD0:


        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_SetDevicePowerState() PowerDeviceD0 (ON)\n"));

        // We'll need to finish the rest in the completion routine;
        //   signal caller we're going to D0 and will need to set a completion routine
        fRes = TRUE;

        // Caller will pass on to PDO ( Physical Device object )
        break;

    default:

        BULKUSB_KdPrint( DBGLVL_MEDIUM,(" Bogus DeviceState = %x\n", DeviceState));
    }

    return fRes;
}



NTSTATUS
BulkUsb_QueryCapabilities(
    IN PDEVICE_OBJECT       LowerDeviceObject,
    IN PDEVICE_CAPABILITIES DeviceCapabilities
    )

/*++

Routine Description:

    This routine generates an internal IRP from this driver to the lower portion
    of the driver stack to obtain information on the Device Object's
    capabilities. We are most interested in learning which system power states
    are to be mapped to which device power states for honoring
    IRP_MJ_SET_POWER Irps.

    This is a blocking call which waits for the IRP completion routine
    to set an event on finishing.

Arguments:

    LowerDeviceObject        - DeviceObject beneath this driver in the stack.

Return Value:

    NTSTATUS value from the IoCallDriver() call.

--*/

{
    PIO_STACK_LOCATION nextStack;
    PIRP irp;
    NTSTATUS ntStatus;
    KEVENT event;


    // This is a DDK-defined DBG-only macro that ASSERTS we are not running pageable code
    // at higher than APC_LEVEL.
    PAGED_CODE();


    // Build an IRP for us to generate an internal query request to the PDO
    irp = IoAllocateIrp(LowerDeviceObject->StackSize, FALSE);

    if (!irp) {
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    //
    // Preinit the device capability structures appropriately.
    //
    RtlZeroMemory( DeviceCapabilities, sizeof(DEVICE_CAPABILITIES) );
    DeviceCapabilities->Size = sizeof(DEVICE_CAPABILITIES);
    DeviceCapabilities->Version = 1;
    DeviceCapabilities->Address = -1;
    DeviceCapabilities->UINumber = -1;
    
    //purnnamu:11/23/2001
    //DeviceCapabilities->Removable =1;
    //DeviceCapabilities->SurpriseRemovalOK=1;  
    

    // IoGetNextIrpStackLocation gives a higher level driver access to the next-lower
    // driver's I/O stack location in an IRP so the caller can set it up for the lower driver.
    nextStack = IoGetNextIrpStackLocation(irp);
    nextStack->MajorFunction= IRP_MJ_PNP;
    nextStack->MinorFunction= IRP_MN_QUERY_CAPABILITIES;

    // init an event to tell us when the completion routine's been called
    KeInitializeEvent(&event, NotificationEvent, FALSE);

    // Set a completion routine so it can signal our event when
    //  the next lower driver is done with the Irp
    IoSetCompletionRoutine(irp,
                           BulkUsb_IrpCompletionRoutine,
                           &event,  // pass the event as Context to completion routine
                           TRUE,    // invoke on success
                           TRUE,    // invoke on error
                           TRUE);   // invoke on cancellation of the Irp


    // set our pointer to the DEVICE_CAPABILITIES struct
    nextStack->Parameters.DeviceCapabilities.Capabilities = DeviceCapabilities;

    // preset the irp to report not supported
    irp->IoStatus.Status = STATUS_NOT_SUPPORTED;

    ntStatus = IoCallDriver(LowerDeviceObject,
                            irp);

    BULKUSB_KdPrint( DBGLVL_MEDIUM,(" BulkUsb_QueryCapabilities() ntStatus from IoCallDriver to PCI = 0x%x\n", ntStatus));

    if (ntStatus == STATUS_PENDING) {
       // wait for irp to complete

       KeWaitForSingleObject(
            &event,
            Suspended,
            KernelMode,
            FALSE,
            NULL);

       ntStatus = irp->IoStatus.Status;
    }

    // failed? this is probably a bug
    BULKUSB_KdPrintCond( DBGLVL_DEFAULT,(!NT_SUCCESS(ntStatus)), ("BulkUsb_QueryCapabilities() failed\n"));

    IoFreeIrp(irp);

    return ntStatus;
}








?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕va一区二区三区| 欧美tickle裸体挠脚心vk| 免费看日韩精品| 亚洲福利一区二区| 亚洲伊人色欲综合网| 亚洲自拍偷拍麻豆| 亚洲一区自拍偷拍| 最新热久久免费视频| 亚洲日本韩国一区| 亚洲成人手机在线| 日本aⅴ亚洲精品中文乱码| 免费观看一级欧美片| 韩国女主播成人在线观看| 国产麻豆成人精品| 北条麻妃一区二区三区| 91在线视频在线| 欧美日韩电影在线| 精品国产区一区| 欧美经典一区二区| 亚洲精品日日夜夜| 奇米四色…亚洲| 懂色av中文字幕一区二区三区| 高清不卡一区二区| 欧美色精品在线视频| 欧美一级欧美三级在线观看| 26uuu成人网一区二区三区| 亚洲国产精品成人综合色在线婷婷| 亚洲欧美日韩电影| 日本成人中文字幕在线视频| 国产大陆亚洲精品国产| 91精彩视频在线观看| 日韩一区二区三区视频在线| 国产精品麻豆视频| 午夜精品福利一区二区蜜股av| 奇米精品一区二区三区在线观看 | 91亚洲资源网| 欧美在线不卡视频| 欧美成人aa大片| 一区二区三区色| 加勒比av一区二区| 欧美日韩一区二区欧美激情 | 国产成人免费在线观看不卡| 色婷婷av一区二区三区之一色屋| 亚洲精品在线电影| 亚洲午夜久久久久久久久电影网| 国产成人精品影院| 91精品国产一区二区三区蜜臀| 一区二区中文字幕在线| 麻豆国产欧美日韩综合精品二区| 97精品国产露脸对白| 久久青草国产手机看片福利盒子 | 国产ts人妖一区二区| 在线观看欧美精品| 日本一区二区三区四区在线视频| 七七婷婷婷婷精品国产| 99re免费视频精品全部| 欧美高清在线一区| 国产精品1区2区3区| 欧美成人女星排行榜| 五月婷婷综合激情| 在线看不卡av| 亚洲欧美日韩国产手机在线| 成人黄色免费短视频| 久久无码av三级| 国产一区视频网站| 精品成人在线观看| 久久精品国产精品亚洲红杏| 91精品国产手机| 日韩在线播放一区二区| 欧美精品aⅴ在线视频| 五月婷婷久久综合| 欧美一区二区女人| 久久99精品久久久| 精品对白一区国产伦| 国产在线观看免费一区| 久久综合九色综合97婷婷| 久久福利视频一区二区| 精品欧美乱码久久久久久| 精品一区二区三区视频| 国产日韩欧美一区二区三区综合 | 怡红院av一区二区三区| 色婷婷狠狠综合| 午夜精品福利一区二区三区蜜桃| 7777精品伊人久久久大香线蕉最新版| 一区二区三区日韩欧美精品| 欧美三日本三级三级在线播放| 亚洲国产一区二区三区青草影视| 欧美日韩精品系列| 蜜桃一区二区三区在线| 久久综合资源网| 成人污污视频在线观看| 亚洲精品日韩专区silk| 欧美日韩一区二区三区四区五区 | 亚洲欧洲三级电影| 欧美色图免费看| 久久99精品国产麻豆婷婷| 国产拍揄自揄精品视频麻豆| 91污在线观看| 丝袜诱惑亚洲看片| 国产欧美精品一区aⅴ影院| 91免费小视频| 蜜桃在线一区二区三区| 国产精品福利一区二区| 欧美一区二区三区精品| 国产成人在线看| 亚洲国产精品自拍| 精品国产1区2区3区| 一本大道av伊人久久综合| 日本人妖一区二区| 亚洲人午夜精品天堂一二香蕉| 欧美日韩高清一区二区| 成人黄色一级视频| 美洲天堂一区二卡三卡四卡视频 | 中文在线一区二区| 欧美乱妇15p| av在线这里只有精品| 日韩影院在线观看| 中文字幕日韩av资源站| 精品国产露脸精彩对白| 欧美日韩综合一区| 成人丝袜视频网| 黑人精品欧美一区二区蜜桃| 一区二区三区在线观看网站| 久久久久国产精品麻豆ai换脸 | 狠狠色2019综合网| 亚洲国产成人tv| 国产精品你懂的在线欣赏| 日韩女优av电影| 欧美午夜免费电影| 色哟哟欧美精品| 成人av在线影院| 国产精品18久久久久| 免费不卡在线观看| 污片在线观看一区二区| 亚洲黄色性网站| 17c精品麻豆一区二区免费| 国产日韩欧美在线一区| 久久综合久久综合久久| 精品日韩av一区二区| 欧美一区二区三区四区久久| 欧美日韩在线三级| 欧美亚洲尤物久久| 欧美视频一区二区三区在线观看| 99综合影院在线| a美女胸又www黄视频久久| 国产福利精品一区| 韩国一区二区三区| 国产一区高清在线| 国产成人日日夜夜| 国产成人亚洲综合a∨猫咪| 国产麻豆日韩欧美久久| 国产精品综合在线视频| 国产精品一级在线| 大美女一区二区三区| 成人一区二区三区中文字幕| 成人激情小说乱人伦| eeuss鲁片一区二区三区在线看| 91色视频在线| 欧美综合天天夜夜久久| 欧美午夜一区二区三区免费大片| 精品视频123区在线观看| 在线综合视频播放| 日韩欧美另类在线| 精品福利视频一区二区三区| 国产亚洲精品福利| 亚洲视频一区二区免费在线观看| 亚洲美女区一区| 蜜桃av一区二区在线观看| 国产一区二区视频在线播放| gogogo免费视频观看亚洲一| 欧美视频一区在线| 久久久九九九九| 一区二区在线观看免费视频播放| 亚洲一区二区欧美| 国内精品免费**视频| www.日韩大片| 91精品婷婷国产综合久久竹菊| 亚洲精品一区二区三区精华液| 国产精品护士白丝一区av| 亚洲444eee在线观看| 激情综合网激情| 91黄色激情网站| 精品国产一区二区三区四区四| 亚洲欧洲韩国日本视频| 日本三级亚洲精品| 91麻豆精品在线观看| 欧美tickle裸体挠脚心vk| 亚洲欧美偷拍另类a∨色屁股| 麻豆91精品视频| 日本道色综合久久| 欧美mv和日韩mv国产网站| 亚洲欧美视频在线观看| 精品一区二区三区香蕉蜜桃 | 欧美一级xxx| 亚洲精品视频观看| 国产综合色在线| 欧洲国内综合视频| 中文字幕 久热精品 视频在线| 日本在线播放一区二区三区| 9i看片成人免费高清|