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

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

?? isopnp.c

?? softusb for atmel avr
?? C
?? 第 1 頁 / 共 3 頁
字號:
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);
            return ntStatus;
        }

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

        break; // end, case IRP_MN_CANCEL_REMOVE_DEVICE

    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 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
        IsoUsb_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;

		// 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
		IsoUsb_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);

        Irp->IoStatus.Status = STATUS_SUCCESS;
        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.
        //
        IsoUsb_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
        //
        IsoUsb_RemoveDevice(DeviceObject);

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

        IoDetachDevice(deviceExtension->TopOfStackDeviceObject);

        ISOUSB_KdPrint( DBGLVL_DEFAULT,("IsoUsb_ProcessPnPIrp() Deleting %08X\n",
                         DeviceObject));
                         
        RtlInitUnicodeString (&DeviceLinkUniCodeString, DeviceLinkName);
        IoDeleteSymbolicLink(&DeviceLinkUniCodeString);
        IoDeleteDevice (DeviceObject);

        return ntStatus; // end, case IRP_MN_REMOVE_DEVICE


    default:
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("IsoUsb_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
						   );

		IsoUsb_DecrementIoCount(DeviceObject);

		ISOUSB_KdPrint( DBGLVL_MAXIMUM,("IsoUsb_ProcessPnPIrp() Exit IsoUsb_ProcessPnPIrp FAILURE %x\n", ntStatus));
		return ntStatus;
    }

    IoCopyCurrentIrpStackLocationToNext(Irp);

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

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

    ntStatus = IoCallDriver(stackDeviceObject,
                            Irp);

    IsoUsb_DecrementIoCount(DeviceObject);

    ISOUSB_KdPrint( DBGLVL_MAXIMUM,("IsoUsb_ProcessPnPIrp() Exit IsoUsb_ProcessPnPIrp %x\n", ntStatus));

    return ntStatus;
}


NTSTATUS
IsoUsb_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 IsoUsb

    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;

    
    ISOUSB_KdPrint( DBGLVL_DEFAULT,("enter IsoUsb_PnPAddDevice()\n"));

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

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

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

        deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;

        //
        // 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.
	IsoUsb_QueryCapabilities(PhysicalDeviceObject,
				 &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\IsoUsb\Parameters )
		// Setting to 0 or 1 in registry disables auto power-down
        IsoUsb_GetRegistryDword( ISOUSB_REGISTRY_PARAMETERS_PATH,
                                         L"PowerDownLevel",
                                         &(deviceExtension->PowerDownLevel) );



        //
        // display the device  caps
        //

        ISOUSB_KdPrint( DBGLVL_MEDIUM,(" >>>>>> DeviceCaps\n"));
        ISOUSB_KdPrint( DBGLVL_MEDIUM,(" SystemWake = %s\n",
            ISOUSB_StringForSysState( deviceExtension->DeviceCapabilities.SystemWake ) ));
        ISOUSB_KdPrint( DBGLVL_MEDIUM,(" DeviceWake = %s\n",
            ISOUSB_StringForDevState( deviceExtension->DeviceCapabilities.DeviceWake) ));

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

            ISOUSB_KdPrint( DBGLVL_MEDIUM,(" Device State Map: sysstate %s = devstate %s\n",
                 ISOUSB_StringForSysState( i ),
                 ISOUSB_StringForDevState( deviceExtension->DeviceCapabilities.DeviceState[i] ) ));
        }
        ISOUSB_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
	//
	IsoUsb_IncrementIoCount(deviceObject);

    }

    USBD_GetUSBDIVersion(&versionInformation);



    if( NT_SUCCESS( ntStatus ) )
    {
	NTSTATUS actStat;
	// try to power up device
	ISOUSB_KdPrint( DBGLVL_DEFAULT,("IsoUsb_PnPAddDevice() - Power Up device\n"));
	actStat = IsoUsb_SelfSuspendOrActivate( deviceObject, FALSE );
    }


    ISOUSB_KdPrint( DBGLVL_DEFAULT,("exit IsoUsb_PnPAddDevice() (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
IsoUsb_StartDevice(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

    Called from IsoUsb_ProcessPnPIrp(), the dispatch routine for IRP_MJ_PNP.
    Initializes a given instance of the device on the USB.
    USB client drivers such as us set up URBs (USB Request Packets) to send requests
    to the host controller driver (HCD). The URB structure defines a format for all
    possible commands that can be sent to a USB device.
    Here, we request the device descriptor and store it, and configure the device.


Arguments:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩丝袜情趣美女图片| 国产精品毛片大码女人| 91福利社在线观看| 九九热在线视频观看这里只有精品| 亚洲美女免费在线| 国产精品女上位| 久久精子c满五个校花| 欧美一级一区二区| 欧美日韩精品一区二区在线播放| 日韩亚洲欧美综合| 在线亚洲人成电影网站色www| 国产精品自拍毛片| 久久精品国产在热久久| 午夜一区二区三区视频| 伊人开心综合网| 亚洲精品你懂的| 亚洲美女在线一区| 中文字幕中文字幕中文字幕亚洲无线| 久久久久亚洲蜜桃| 久久综合色鬼综合色| 精品成人私密视频| wwwwxxxxx欧美| 欧美经典一区二区| 久久日韩粉嫩一区二区三区| 日韩欧美在线观看一区二区三区| 欧美精品自拍偷拍| 色欧美日韩亚洲| 欧美美女bb生活片| 欧美精品vⅰdeose4hd| 欧美日韩亚洲高清一区二区| 欧洲在线/亚洲| 欧美一区二区免费视频| 欧美r级在线观看| 久久精品视频一区二区三区| 久久久精品黄色| 久久综合给合久久狠狠狠97色69| 国产精品美女久久久久久| 中文字幕免费一区| 亚洲精品视频一区二区| 亚洲精品亚洲人成人网| 日韩在线一区二区| 精品无码三级在线观看视频 | 亚洲女与黑人做爰| 亚洲日本韩国一区| 午夜欧美大尺度福利影院在线看| 日韩高清一区在线| 国产一区二区三区电影在线观看| 99精品在线免费| 日本黄色一区二区| 欧美一区二区三区在线观看| 精品国产一区二区在线观看| 欧美日韩中文字幕一区| 日韩欧美第一区| 国产亚洲午夜高清国产拍精品| 中文字幕中文在线不卡住| 亚洲国产日韩精品| 国产麻豆精品在线| 欧美国产一区二区| 亚洲影院理伦片| 麻豆精品视频在线| 成人黄色小视频| 欧美日韩大陆一区二区| 26uuu国产在线精品一区二区| 国产精品久久久久影视| 亚洲成人免费视频| 国产v综合v亚洲欧| 欧美日韩另类一区| 久久先锋影音av| 一区二区三区小说| 亚洲电影你懂得| 成人在线综合网站| 7777精品伊人久久久大香线蕉的 | 91在线观看下载| 欧美日韩极品在线观看一区| 日韩欧美黄色影院| 国产精品另类一区| 日本成人在线电影网| 成人黄色网址在线观看| 欧美精品18+| 日韩美女视频一区二区| 国产精品资源站在线| 7777精品伊人久久久大香线蕉的 | 日本精品免费观看高清观看| 国产免费观看久久| 国精品**一区二区三区在线蜜桃| 欧美日韩1234| 亚洲午夜一区二区| 色哟哟国产精品免费观看| 久久久精品综合| 精品亚洲成av人在线观看| 91精品国产乱| 日韩成人一区二区| 亚洲乱码中文字幕| 成人福利视频在线| 欧美韩国一区二区| 成人在线综合网站| 日本一区二区动态图| 国产河南妇女毛片精品久久久| 精品国产乱码久久久久久1区2区| 日韩av在线播放中文字幕| 欧美三级电影在线看| 一级精品视频在线观看宜春院 | 69精品人人人人| 午夜精品在线看| 欧美日韩国产首页| 视频一区在线视频| 欧美一区二区视频在线观看| 日本中文字幕一区| 欧美一二三在线| 久久99精品国产麻豆不卡| 日韩一二三区视频| 国产一区二区视频在线| 欧美精品一区二区三区在线 | 蜜臀av性久久久久蜜臀aⅴ| 欧美放荡的少妇| 日韩影视精彩在线| 日韩精品专区在线影院观看| 狠狠狠色丁香婷婷综合激情| 精品国产91洋老外米糕| 国产精品亚洲一区二区三区妖精| 国产欧美日韩激情| 99久久精品一区二区| 一区二区成人在线视频| 717成人午夜免费福利电影| 美日韩一区二区三区| 26uuu亚洲综合色| 成人免费看的视频| 亚洲欧美日韩一区二区三区在线观看| 在线亚洲精品福利网址导航| 午夜伊人狠狠久久| 精品国产一区二区在线观看| 成人性生交大合| 成人性生交大片免费看中文| 国产精品久久久久7777按摩| 色综合久久久久综合| 日日夜夜免费精品视频| 色成年激情久久综合| 91精品国产福利在线观看| 日韩国产欧美一区二区三区| 欧美白人最猛性xxxxx69交| 国产精品一区二区免费不卡| 国产精品福利一区二区| 在线视频亚洲一区| 免费在线观看不卡| 欧美激情资源网| 欧美三级资源在线| 国产一区二区调教| 一区二区三区中文在线| 日韩一区二区在线播放| 国产福利精品一区| 一级中文字幕一区二区| 欧美大片在线观看| 91丨porny丨首页| 美国av一区二区| 亚洲啪啪综合av一区二区三区| 欧美日韩亚洲高清一区二区| 国产寡妇亲子伦一区二区| 亚洲精品成人a在线观看| 日韩精品一区二区三区四区视频 | 国产伦精品一区二区三区免费迷 | 久久综合狠狠综合久久激情| 99久久夜色精品国产网站| 午夜欧美2019年伦理| 中文在线免费一区三区高中清不卡| 欧美日韩在线播放一区| 国产成人午夜视频| 日本欧美在线观看| 亚洲精品欧美在线| 国产亚洲精品久| 91精品国模一区二区三区| 99久久精品免费看国产| 六月丁香婷婷色狠狠久久| 一区二区高清在线| 国产精品青草综合久久久久99| 国产精品毛片a∨一区二区三区 | 国产精品嫩草影院av蜜臀| 91精品国产综合久久久蜜臀图片| 99久久精品国产一区| 国内成人精品2018免费看| 三级精品在线观看| 亚洲欧美日韩精品久久久久| 日韩精品一区二区三区视频在线观看| 在线欧美小视频| www.成人在线| 国产一区二区h| 美女诱惑一区二区| 亚洲观看高清完整版在线观看| 中国av一区二区三区| 久久久久久久久久久久久久久99| 欧美精品在线一区二区三区| 91高清在线观看| 99精品国产热久久91蜜凸| 国产91在线看| 国产精品正在播放| 国产毛片精品视频| 精品一区二区三区蜜桃| 奇米777欧美一区二区| 亚洲福利视频三区| 亚洲一区二区高清| 一区二区日韩av|