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

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

?? bulkpnp.c

?? s3c2440的usb驅(qū)動代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
            BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_ProcessPnPIrp() IRP_MN_CANCEL_REMOVE_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            BulkUsb_DecrementIoCount(DeviceObject);
            return ntStatus;
        }

                // Reset this flag so new IOCTL and IO Irp processing will be re-enabled
        deviceExtension->RemoveDeviceRequested = FALSE;
        Irp->IoStatus.Status = STATUS_SUCCESS;

        break; // end, case IRP_MN_CANCEL_REMOVE_DEVICE

    case IRP_MN_SURPRISE_REMOVAL:
        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_ProcessPnPIrp() IRP_MN_SURPRISE_REMOVAL\n"));

        // For a surprise-style device removal ( i.e. sudden cord yank ),
        // the physical device has already been removed so the PnP Manager sends
        // the remove IRP without a prior query-remove. A device can be in any state
        // when it receives a remove IRP as a result of a surprise-style removal.

        // match the inc at the begining of the dispatch routine
        BulkUsb_DecrementIoCount(DeviceObject);

        //
        // Once DeviceRemoved is set no new IOCTL or read/write irps will be passed
        // down the stack to lower drivers; all will be quickly failed
        //
        deviceExtension->DeviceRemoved = TRUE;

        // Cancel any pending io requests; we may not have gotten a query first!
        BulkUsb_CancelPendingIo( DeviceObject );

        // If any pipes are still open, call USBD with URB_FUNCTION_ABORT_PIPE
        // This call will also close the pipes; if any user close calls get through,
        // they will be noops
        BulkUsb_AbortPipes( DeviceObject );

        //
        // Mark this handled
        //
        Irp->IoStatus.Status = STATUS_SUCCESS;

        // We don't explicitly wait for the below driver to complete, but just make
        // the call and go on, finishing cleanup
        IoCopyCurrentIrpStackLocationToNext(Irp);

        ntStatus = IoCallDriver(stackDeviceObject,
                                Irp);

        return ntStatus;

    case IRP_MN_REMOVE_DEVICE:

        // The PnP Manager uses this IRP to direct drivers to remove a device.
        // For a "polite" device removal, the PnP Manager sends an
        // IRP_MN_QUERY_REMOVE_DEVICE prior to the remove IRP. In this case,
        // the device is in the remove-pending state when the remove IRP arrives.
        // For a surprise-style device removal ( i.e. sudden cord yank ),
        // the physical device has already been removed and the PnP Manager may not
        //  have sent IRP_MN_SURPRISE_REMOVAL. A device can be in any state
        // when it receives a remove IRP as a result of a surprise-style removal.

        // match the inc at the begining of the dispatch routine
        BulkUsb_DecrementIoCount(DeviceObject);

        //
        // Once DeviceRemoved is set no new IOCTL or read/write irps will be passed
        // down the stack to lower drivers; all will be quickly failed
        //
        deviceExtension->DeviceRemoved = TRUE;

        // Cancel any pending io requests; we may not have gotten a query first!
        BulkUsb_CancelPendingIo( DeviceObject );

        // If any pipes are still open, call USBD with URB_FUNCTION_ABORT_PIPE
        // This call will also close the pipes; if any user close calls get through,
        // they will be noops
        BulkUsb_AbortPipes( DeviceObject );

        // We don't explicitly wait for the below driver to complete, but just make
        // the call and go on, finishing cleanup
        IoCopyCurrentIrpStackLocationToNext(Irp);

        ntStatus = IoCallDriver(stackDeviceObject,
                                Irp);
        //
        // The final decrement to device extension PendingIoCount == 0
                // will set deviceExtension->RemoveEvent, enabling device removal.
                // If there is no pending IO at this point, the below decrement will be it.
        //
        BulkUsb_DecrementIoCount(DeviceObject);


        // wait for any io request pending in our driver to
        // complete for finishing the remove

        KeWaitForSingleObject(
                    &deviceExtension->RemoveEvent,
                    Suspended,
                    KernelMode,
                    FALSE,
                    NULL);

        //
        // Delete the link and FDO we created
        //
        BulkUsb_RemoveDevice(DeviceObject);


        BULKUSB_KdPrint( DBGLVL_DEFAULT,("BulkUsb_ProcessPnPIrp() Detaching from %08X\n",
                         deviceExtension->TopOfStackDeviceObject));

        IoDetachDevice(deviceExtension->TopOfStackDeviceObject);

        BULKUSB_KdPrint( DBGLVL_DEFAULT,("BulkUsb_ProcessPnPIrp() Deleting %08X\n",
                         DeviceObject));

        IoDeleteDevice (DeviceObject);

        return ntStatus; // end, case IRP_MN_REMOVE_DEVICE


    default:

        //
        // In this case we must not touch the status. As ntstatus is
        // STATUS_SUCCESS, we will skip the failure case and pass down the IRP
        // untouched.
        //
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_ProcessPnPIrp() Minor PnP IOCTL not handled\n"));
    } /* case MinorFunction  */


    if (!NT_SUCCESS(ntStatus)) {

        // if anything went wrong, return failure  without passing Irp down
        Irp->IoStatus.Status = ntStatus;
        IoCompleteRequest (Irp,
                                           IO_NO_INCREMENT
                                           );

        BulkUsb_DecrementIoCount(DeviceObject);

        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_ProcessPnPIrp() Exit BulkUsb_ProcessPnPIrp FAILURE %x\n", ntStatus));
        return ntStatus;
    }

    IoCopyCurrentIrpStackLocationToNext(Irp);

    //
    // All PNP_POWER messages get passed to the TopOfStackDeviceObject
    // we were given in PnPAddDevice
    //

    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_ProcessPnPIrp() Passing PnP Irp down, status = %x\n", ntStatus));

    ntStatus = IoCallDriver(stackDeviceObject,
                            Irp);

    BulkUsb_DecrementIoCount(DeviceObject);

    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_ProcessPnPIrp() Exit BulkUsb_ProcessPnPIrp %x\n", ntStatus));

    return ntStatus;
}


NTSTATUS
BulkUsb_PnPAddDevice(
    IN PDRIVER_OBJECT DriverObject,
    IN PDEVICE_OBJECT PhysicalDeviceObject
    )
/*++

Routine Description:

    This routine is called to create and initialize our Functional Device Object (FDO).
    For monolithic drivers, this is done in DriverEntry(), but Plug and Play devices
    wait for a PnP event

Arguments:

    DriverObject - pointer to the driver object for this instance of BulkUsb

    PhysicalDeviceObject - pointer to a device object created by the bus

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/
{
    NTSTATUS                ntStatus = STATUS_SUCCESS;
    PDEVICE_OBJECT          deviceObject = NULL;
    PDEVICE_EXTENSION       deviceExtension;
    USBD_VERSION_INFORMATION versionInformation;
    ULONG i;



    BULKUSB_KdPrint( DBGLVL_DEFAULT,("enter BulkUsb_PnPAddDevice()\n"));

    //
    // create our funtional device object (FDO)
    //

    ntStatus =
        BulkUsb_CreateDeviceObject(DriverObject, PhysicalDeviceObject, &deviceObject);

    if (NT_SUCCESS(ntStatus)) {
        deviceExtension = deviceObject->DeviceExtension;

        //
        // we support direct io for read/write
        //
        deviceObject->Flags |= DO_DIRECT_IO;


        //Set this flag causes the driver to not receive a IRP_MN_STOP_DEVICE
        //during suspend and also not get an IRP_MN_START_DEVICE during resume.
        //This is neccesary because during the start device call,
        // the GetDescriptors() call  will be failed by the USB stack.
        deviceObject->Flags |= DO_POWER_PAGABLE;

        // initialize our device extension
        //
        // remember the Physical device Object
        //
        deviceExtension->PhysicalDeviceObject=PhysicalDeviceObject;

        //
        // Attach to the PDO
        //

        deviceExtension->TopOfStackDeviceObject =
            IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);

        // Get a copy of the physical device's capabilities into a
        // DEVICE_CAPABILITIES struct in our device extension;
        // We are most interested in learning which system power states
        // are to be mapped to which device power states for handling
        // IRP_MJ_SET_POWER Irps.
        BulkUsb_QueryCapabilities(deviceExtension->TopOfStackDeviceObject,
                                 &deviceExtension->DeviceCapabilities);


                // We want to determine what level to auto-powerdown to; This is the lowest
                //  sleeping level that is LESS than D3;
                // If all are set to D3, auto powerdown/powerup will be disabled.

        deviceExtension->PowerDownLevel = PowerDeviceUnspecified; // init to disabled
        for (i=PowerSystemSleeping1; i<= PowerSystemSleeping3; i++) {

                        if ( deviceExtension->DeviceCapabilities.DeviceState[i] < PowerDeviceD3 )
                                deviceExtension->PowerDownLevel = deviceExtension->DeviceCapabilities.DeviceState[i];
        }

#if DBG

        // May want override auto power-down level from registry;
        // ( CurrentControlSet\Services\BulkUsb\Parameters )
                // Setting to 0 or 1 in registry disables auto power-down
        BulkUsb_GetRegistryDword( BULKUSB_REGISTRY_PARAMETERS_PATH,
                                         L"PowerDownLevel",
                                         &(deviceExtension->PowerDownLevel) );



        //
        // display the device  caps
        //

        BULKUSB_KdPrint( DBGLVL_MEDIUM,(" >>>>>> DeviceCaps\n"));
        BULKUSB_KdPrint( DBGLVL_MEDIUM,(" SystemWake = %s\n",
            BULKUSB_StringForSysState( deviceExtension->DeviceCapabilities.SystemWake ) ));
        BULKUSB_KdPrint( DBGLVL_MEDIUM,(" DeviceWake = %s\n",
            BULKUSB_StringForDevState( deviceExtension->DeviceCapabilities.DeviceWake) ));

        for (i=PowerSystemUnspecified; i< PowerSystemMaximum; i++) {

            BULKUSB_KdPrint( DBGLVL_MEDIUM,(" Device State Map: sysstate %s = devstate %s\n",
                 BULKUSB_StringForSysState( i ),
                 BULKUSB_StringForDevState( deviceExtension->DeviceCapabilities.DeviceState[i] ) ));
        }
        BULKUSB_KdPrint( DBGLVL_MEDIUM,(" <<<<<<<<DeviceCaps\n"));
#endif
        // We keep a pending IO count ( extension->PendingIoCount )  in the device extension.
        // The first increment of this count is done on adding the device.
        // Subsequently, the count is incremented for each new IRP received and
        // decremented when each IRP is completed or passed on.

        // Transition to 'one' therefore indicates no IO is pending and signals
        // deviceExtension->NoPendingIoEvent. This is needed for processing
        // IRP_MN_QUERY_REMOVE_DEVICE

        // Transition to 'zero' signals an event ( deviceExtension->RemoveEvent )
        // to enable device removal. This is used in processing for IRP_MN_REMOVE_DEVICE
        //
        BulkUsb_IncrementIoCount(deviceObject);

    }

    USBD_GetUSBDIVersion(&versionInformation);



    if( NT_SUCCESS( ntStatus ) )
    {
        NTSTATUS actStat;
        // try to power down device until IO actually requested
        actStat = BulkUsb_SelfSuspendOrActivate( deviceObject, TRUE );

        deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
    }


    BULKUSB_KdPrint( DBGLVL_DEFAULT,("exit BulkUsb_PnPAddDevice() (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
69堂精品视频| 欧美精品一区二区三区高清aⅴ| 日本伊人精品一区二区三区观看方式| 日本高清无吗v一区| 精品视频在线视频| 91色乱码一区二区三区| 大胆欧美人体老妇| 久久99国产精品免费网站| 欧美一级片在线| 国产在线精品一区二区夜色| 日本一区二区免费在线| 一区二区三区在线免费播放| 国产精品欧美经典| 日韩久久一区二区| 亚洲一区二区四区蜜桃| 男男成人高潮片免费网站| 国产精品亚洲午夜一区二区三区| 成人18精品视频| 91麻豆123| 欧美日韩国产天堂| 精品久久五月天| 艳妇臀荡乳欲伦亚洲一区| 久久老女人爱爱| 亚洲线精品一区二区三区八戒| 奇米一区二区三区| 国产精品影视在线| 在线观看欧美黄色| 久久男人中文字幕资源站| 国产精品伦一区| 亚洲国产精品自拍| eeuss影院一区二区三区| 91精品一区二区三区久久久久久| 国产精品进线69影院| 视频一区二区欧美| 成人黄色a**站在线观看| 欧美成人性福生活免费看| 中文字幕av在线一区二区三区| 香蕉影视欧美成人| 国产精品综合网| 欧美日韩一级二级三级| 2021国产精品久久精品| 亚洲欧美中日韩| 蜜臀av性久久久久蜜臀aⅴ流畅| av高清不卡在线| 欧美日韩高清不卡| 亚洲摸摸操操av| 亚洲国产日韩精品| 中文字幕 久热精品 视频在线 | 久久久99久久| 欧美高清精品3d| 亚洲欧洲成人精品av97| 激情欧美日韩一区二区| 欧美精品自拍偷拍| 亚洲男人天堂av| 成人黄色免费短视频| 精品粉嫩aⅴ一区二区三区四区| 亚洲综合999| 国产精品中文字幕一区二区三区| 久久影音资源网| 日韩成人一区二区三区在线观看| 99精品久久只有精品| 欧美成人官网二区| av亚洲精华国产精华| 欧美日韩亚洲高清一区二区| 一区二区在线观看视频在线观看| 国产成a人亚洲精品| 久久久www免费人成精品| 日韩精品一级二级| 欧美性色黄大片手机版| 亚洲另类色综合网站| 欧美中文字幕一区二区三区亚洲| 国产精品久久福利| 国产一本一道久久香蕉| 99精品1区2区| 欧美日韩国产高清一区二区| 国产99久久久国产精品免费看| 国产资源在线一区| 欧美三日本三级三级在线播放| 成人激情文学综合网| 亚洲一区二区三区四区中文字幕 | 欧美一级欧美三级| 亚洲午夜在线观看视频在线| 欧美视频你懂的| 亚洲一区av在线| 91麻豆国产福利精品| 国产精品成人免费精品自在线观看| av福利精品导航| 爽好多水快深点欧美视频| 欧美精品一区二区三区视频| 欧美日韩一二三| 另类专区欧美蜜桃臀第一页| 久久综合九色综合欧美就去吻 | 午夜在线成人av| 精品久久久久久亚洲综合网| 成人免费三级在线| 亚洲一二三区不卡| 久久婷婷国产综合精品青草| 色噜噜夜夜夜综合网| 日韩激情视频网站| 国产清纯在线一区二区www| 成人av片在线观看| 亚洲一区二区三区影院| 国产亚洲人成网站| 欧美综合久久久| 高清久久久久久| 蜜桃一区二区三区在线观看| 亚洲狼人国产精品| 26uuu精品一区二区| 欧美吻胸吃奶大尺度电影 | 日韩精品一区二区三区视频在线观看 | 精品少妇一区二区三区视频免付费| 欧美成人性战久久| 亚洲精品国产第一综合99久久| 日本特黄久久久高潮| 美女视频一区二区三区| 精品国产三级电影在线观看| 国产高清不卡一区| 国产嫩草影院久久久久| 日韩欧美在线观看一区二区三区| 成人不卡免费av| 激情都市一区二区| 午夜视频一区二区三区| 欧美国产精品劲爆| 欧美色综合天天久久综合精品| 日本视频一区二区| 26uuu国产日韩综合| 国内成人自拍视频| 国产精品国产三级国产aⅴ中文 | 2019国产精品| 91高清视频免费看| 天堂一区二区在线免费观看| 久久久久久久久久久99999| 久久网站最新地址| 在线看一区二区| 日韩高清不卡一区二区三区| 中文字幕+乱码+中文字幕一区| 中日韩av电影| 欧美日韩国产另类不卡| 日本韩国一区二区三区| 色综合天天综合| 97超碰欧美中文字幕| 99精品视频在线播放观看| 99久免费精品视频在线观看 | 亚洲欧美日韩在线不卡| 亚洲乱码日产精品bd| 日韩黄色在线观看| 国产精品99久久久久久似苏梦涵 | 极品少妇一区二区三区精品视频| 高清不卡在线观看| 欧美午夜精品一区| 精品国产成人系列| 亚洲精品欧美激情| 蜜臀av性久久久久av蜜臀妖精 | 欧美挠脚心视频网站| 精品福利在线导航| 一区二区三区在线视频观看58| 日本不卡高清视频| 成人18精品视频| 日韩一区二区三区视频| 欧美国产一区视频在线观看| 亚洲一区二区三区国产| 国产精品一级二级三级| 欧美人体做爰大胆视频| 亚洲国产高清在线| 乱一区二区av| 欧美午夜精品一区二区三区| 国产欧美一区二区三区在线看蜜臀 | 久久色成人在线| 无码av中文一区二区三区桃花岛| 国产91丝袜在线播放九色| 欧美在线观看一区二区| 国产人妖乱国产精品人妖| 亚洲h动漫在线| 一本一道久久a久久精品| 精品久久久久久久久久久久包黑料 | 欧美日韩在线电影| 亚洲国产精品激情在线观看| 蜜桃精品视频在线观看| 欧美在线观看一区二区| 国产精品超碰97尤物18| 国产精品系列在线观看| 日韩欧美www| 亚洲五码中文字幕| 91麻豆精品在线观看| 国产欧美一区二区精品婷婷| 精品亚洲成a人在线观看 | 色哟哟在线观看一区二区三区| 中文字幕精品一区二区三区精品| 日韩成人伦理电影在线观看| 在线亚洲人成电影网站色www| 中文字幕av一区二区三区高| 国产成人aaaa| 久久蜜桃av一区精品变态类天堂 | 成人伦理片在线| 国产免费观看久久| 国产精品1区2区3区| 国产亚洲欧洲一区高清在线观看| 老司机免费视频一区二区三区| 日韩三级伦理片妻子的秘密按摩| 日日夜夜精品视频天天综合网|