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

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

?? isopnp.c

?? USB技術大全-54.8M.zip
?? C
?? 第 1 頁 / 共 3 頁
字號:
	/*++

Copyright (c) 1997-1998  Microsoft Corporation

Module Name:

    IsoPnp.c 

Abstract:

    Isochronous USB device driver for Intel 82930 USB test board
    Plug and Play module

Environment:

    kernel mode only

Notes:

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  PURPOSE.

  Copyright (c) 1997-1998 Microsoft Corporation.  All Rights Reserved.


Revision History:

    2/7/98: created

--*/


#include "wdm.h"
#include "stdarg.h"
#include "stdio.h"

#include "usbdi.h"
#include "usbdlib.h"
#include "Iso82930.h"



NTSTATUS
IsoUsb_ProcessPnPIrp(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP           Irp
    )
/*++

Routine Description:

    Dispatch table routine for IRP_MJ_PNP.
    Process the Plug and Play IRPs sent to this device.

Arguments:

    DeviceObject - pointer to our FDO (Functional Device Object)

    Irp          - pointer to an I/O Request Packet

Return Value:

    NT status code

--*/
{

    PIO_STACK_LOCATION irpStack;
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus = STATUS_SUCCESS;
    NTSTATUS waitStatus;
    PDEVICE_OBJECT stackDeviceObject;
    KEVENT startDeviceEvent;
    UNICODE_STRING DeviceLinkUniCodeString;
    WCHAR DeviceLinkName[] = L"\\DosDevices\\AVR309USB_0";

    //
    // Get a pointer to the current location in the Irp. This is where
    //     the function codes and parameters are located.
    //
    irpStack = IoGetCurrentIrpStackLocation (Irp);

    //
    // Get a pointer to the device extension
    //
    deviceExtension = DeviceObject->DeviceExtension;
    stackDeviceObject = deviceExtension->TopOfStackDeviceObject;

    ISOUSB_KdPrint( DBGLVL_MEDIUM, ( "enter IsoUsb_ProcessPnPIrp() IRP_MJ_PNP, minor %s\n",
        ISOUSB_StringForPnpMnFunc( irpStack->MinorFunction ) ));

	// inc the FDO device extension's pending IO count for this Irp
    IsoUsb_IncrementIoCount(DeviceObject);

    ISOUSB_ASSERT( IRP_MJ_PNP == irpStack->MajorFunction );

    switch (irpStack->MinorFunction) {
    case IRP_MN_START_DEVICE:

		// The PnP Manager sends this IRP after it has assigned resources, 
		// if any, to the device. The device may have been recently enumerated
		// and is being started for the first time, or the device may be 
		// restarting after being stopped for resource reconfiguration. 

		// Initialize an event we can wait on for the PDO to be done with this irp
        KeInitializeEvent(&startDeviceEvent, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);

        // Set a completion routine so it can signal our event when
        //  the PDO is done with the Irp
        IoSetCompletionRoutine(Irp,
                               IsoUsb_IrpCompletionRoutine,
                               &startDeviceEvent,  // pass the event to the completion routine as the Context
                               TRUE,    // invoke on success
                               TRUE,    // invoke on error
                               TRUE);   // invoke on cancellation


        // let the PDO process the IRP
        ntStatus = IoCallDriver(stackDeviceObject,
                                Irp);

        // if PDO is not done yet, wait for the event to be set in our completion routine
        if (ntStatus == STATUS_PENDING) {
             // wait for irp to complete

            waitStatus = KeWaitForSingleObject(
                &startDeviceEvent,
                Suspended,
                KernelMode,
                FALSE,
                NULL);
        }

        // Now we're ready to do our own startup processing.
        // 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.
        ntStatus = IsoUsb_StartDevice(DeviceObject);
        Irp->IoStatus.Status = ntStatus;

		IoCompleteRequest (Irp,
						   IO_NO_INCREMENT
						   );

		IsoUsb_DecrementIoCount(DeviceObject);
		return ntStatus;  // end, case IRP_MN_START_DEVICE

    case IRP_MN_QUERY_STOP_DEVICE:

		// The IRP_MN_QUERY_STOP_DEVICE/IRP_MN_STOP_DEVICE sequence only occurs
		// during "polite" shutdowns, such as the user explicitily requesting the
		// service be stopped in, or requesting unplug from the Pnp tray icon.
		// This sequence is NOT received during "impolite" shutdowns,
		// such as someone suddenly yanking the USB cord or otherwise 
		// unexpectedly disabling/resetting the device.

        // If a driver sets STATUS_SUCCESS for this IRP,
        // the driver must not start any operations on the device that
        // would prevent that driver from successfully completing an IRP_MN_STOP_DEVICE
        // for the device.
        // For mass storage devices such as disk drives, while the device is in the
        // stop-pending state,the driver holds IRPs that require access to the device,
        // but for most USB devices, there is no 'persistent storage', so we will just
        // refuse any more IO until restarted or the stop is cancelled

        // If a driver in the device stack determines that the device cannot be
        // stopped for resource reconfiguration, the driver is not required to pass
        // the IRP down the device stack. If a query-stop IRP fails,
        // the PnP Manager sends an IRP_MN_CANCEL_STOP_DEVICE to the device stack,
        // notifying the drivers for the device that the query has been cancelled
        // and that the device will not be stopped.


        // It is possible to receive this irp when the device has not been started
        //  ( as on a boot device )
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_QUERY_STOP_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);

            return ntStatus;
        }


        // fail the request if we have any read/write IRPS pending
        if( deviceExtension->PendingIoCount > 1 ) {
            ntStatus = STATUS_UNSUCCESSFUL;
        }
        else { 
			// We'll not veto it; pass it on and flag that stop was requested.
			// Once StopDeviceRequested is set no new IOCTL or read/write irps will be passed
			// down the stack to lower drivers; all will be quickly failed
             deviceExtension->StopDeviceRequested = TRUE;
             ntStatus = STATUS_SUCCESS;
        }
        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_QUERY_STOP_DEVICE

    case IRP_MN_CANCEL_STOP_DEVICE:

		// The PnP Manager uses this IRP to inform the drivers for a device
		// that the device will not be stopped for resource reconfiguration.
		// This should only be received after a successful IRP_MN_QUERY_STOP_DEVICE.

        // It is possible to receive this irp when the device has not been started
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_CANCEL_STOP_DEVICE when device not started\n"));
            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->StopDeviceRequested = FALSE;
        break; // end, case IRP_MN_CANCEL_STOP_DEVICE

    case IRP_MN_STOP_DEVICE:

		// The PnP Manager sends this IRP to stop a device so it can reconfigure
		// its hardware resources. The PnP Manager only sends this IRP if a prior
		// IRP_MN_QUERY_STOP_DEVICE completed successfully.


        //
        // Send the select configuration urb with a NULL pointer for the configuration
        // handle, this closes the configuration and puts the device in the 'unconfigured'
        // state.
        //
        ntStatus = IsoUsb_StopDevice(DeviceObject);
        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_STOP_DEVICE
 

    case IRP_MN_QUERY_REMOVE_DEVICE:

        //  In response to this IRP, drivers indicate whether the device can be
        //  removed without disrupting the system.
        //  If a driver determines it is safe to remove the device,
        //  the driver completes any outstanding I/O requests, arranges to hold any subsequent
        //  read/write requests, and sets Irp->IoStatus.Status to STATUS_SUCCESS. Function
        //  and filter drivers then pass the IRP to the next-lower driver in the device stack.
        //  The underlying bus driver calls IoCompleteRequest.

        //  If a driver sets STATUS_SUCCESS for this IRP, the driver must not start any
        //  operations on the device that would prevent that driver from successfully completing
        //  an IRP_MN_REMOVE_DEVICE for the device. If a driver in the device stack determines
        //  that the device cannot be removed, the driver is not required to pass the
        //  query-remove IRP down the device stack. If a query-remove IRP fails, the PnP Manager
        //  sends an IRP_MN_CANCEL_REMOVE_DEVICE to the device stack, notifying the drivers for
        //  the device that the query has been cancelled and that the device will not be removed.

        // It is possible to receive this irp when the device has not been started
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_QUERY_STOP_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);

            return ntStatus;
        }

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

        // Wait for any io request pending in our driver to
        // complete before returning success.
		// This  event is set when deviceExtension->PendingIoCount goes to 1
        waitStatus = KeWaitForSingleObject(
                    &deviceExtension->NoPendingIoEvent,
                    Suspended,
                    KernelMode,
                    FALSE,
                    NULL);

        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_QUERY_REMOVE_DEVICE

    case IRP_MN_CANCEL_REMOVE_DEVICE:

		// The PnP Manager uses this IRP to inform the drivers
		// for a device that the device will not be removed.
		// It is sent only after a successful IRP_MN_QUERY_REMOVE_DEVICE.

        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_CANCEL_REMOVE_DEVICE when device not started\n"));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美视频一区二区| 国产福利一区在线观看| 亚洲不卡一区二区三区| 亚洲精品免费电影| 夜夜夜精品看看| 午夜久久久影院| 日韩成人一级大片| 狠狠色丁香久久婷婷综| 国产一区二区三区电影在线观看| 久久国产精品区| 黄色日韩网站视频| 国产麻豆精品在线观看| 丁香五精品蜜臀久久久久99网站 | 91福利社在线观看| 色94色欧美sute亚洲线路一ni| 欧美在线视频不卡| 欧美日韩国产综合草草| 日韩一级成人av| 久久久www免费人成精品| 国产日韩欧美精品电影三级在线 | 激情综合色丁香一区二区| 久草精品在线观看| 成人一区二区在线观看| 一本色道久久综合亚洲91| 欧美日韩一级片网站| 欧美tickle裸体挠脚心vk| 亚洲国产高清aⅴ视频| 亚洲免费视频中文字幕| 日韩**一区毛片| 国产精品一卡二卡| 一本色道亚洲精品aⅴ| 欧美丰满一区二区免费视频 | 亚洲色大成网站www久久九九| 亚洲伦在线观看| 五月天婷婷综合| 国产精品一区一区三区| 色88888久久久久久影院野外| 欧美一区三区二区| 国产女主播在线一区二区| 亚洲精品视频在线观看网站| 喷白浆一区二区| 99精品桃花视频在线观看| 欧美日韩精品欧美日韩精品| 久久久国产一区二区三区四区小说 | 欧美麻豆精品久久久久久| 26uuu亚洲综合色欧美| 国产精品久久久久久久岛一牛影视 | 成人avav在线| 欧美日韩精品高清| 国产欧美视频一区二区三区| 亚洲1区2区3区视频| 高清在线不卡av| 欧美老肥妇做.爰bbww| 日本一区二区久久| 日韩在线a电影| 99久久亚洲一区二区三区青草| 3751色影院一区二区三区| 国产精品久久久久久久久久久免费看| 日本中文字幕一区| 91成人在线免费观看| 国产日韩欧美一区二区三区乱码 | 久久疯狂做爰流白浆xx| 91精彩视频在线| 久久精品亚洲一区二区三区浴池| 一区二区三区中文免费| 成人免费看的视频| 欧美成人精品3d动漫h| 亚洲另类在线视频| 丁香激情综合国产| 日韩色视频在线观看| 亚洲一区二区三区在线播放| 成人av在线影院| 国产午夜精品一区二区三区嫩草| 午夜欧美电影在线观看| 色婷婷综合久久久久中文| 国产精品系列在线| 国产老女人精品毛片久久| 日韩欧美综合在线| 天天综合网 天天综合色| 色婷婷综合中文久久一本| 国产精品久久久久久福利一牛影视| 国产一区二区三区最好精华液| 欧美日韩免费电影| 一区二区欧美视频| 97se亚洲国产综合在线| 国产精品色哟哟网站| 国产99一区视频免费| 欧美成人三级电影在线| 日本三级亚洲精品| 91.麻豆视频| 午夜精品123| 欧美日韩一区二区三区免费看| 亚洲精品国产无套在线观| 99re热这里只有精品视频| 日本一区二区三区四区| 国产激情一区二区三区四区| 亚洲精品一区二区三区蜜桃下载| 麻豆成人在线观看| 日韩免费电影网站| 黄色小说综合网站| 国产婷婷色一区二区三区| 国产成a人亚洲| 国产精品视频你懂的| 白白色亚洲国产精品| 国产精品三级在线观看| 99久久伊人久久99| 亚洲综合视频在线观看| 欧美日韩午夜在线视频| 五月综合激情网| 91精品国产入口| 蜜桃视频在线一区| 久久综合色播五月| 成人晚上爱看视频| 中文字幕在线观看一区| 91视频在线观看| 亚洲在线视频一区| 91精品国产综合久久婷婷香蕉| 蜜臀av亚洲一区中文字幕| 久久中文娱乐网| 99久久婷婷国产精品综合| 亚洲一区在线观看免费| 5月丁香婷婷综合| 国产综合久久久久久久久久久久| 亚洲国产精品成人综合色在线婷婷| 不卡视频免费播放| 樱花影视一区二区| 日韩一级黄色片| 成人美女在线观看| 亚洲国产一二三| 日韩免费高清av| 不卡影院免费观看| 三级不卡在线观看| 亚洲国产精品av| 欧美日韩国产成人在线91| 久久福利资源站| 亚洲免费在线观看| 欧美mv日韩mv国产网站app| av不卡一区二区三区| 午夜在线成人av| 久久久www免费人成精品| 色婷婷综合在线| 久久99久国产精品黄毛片色诱| 国产精品久久久久毛片软件| 欧美精品一级二级三级| 国产不卡视频一区二区三区| 亚洲午夜视频在线观看| 久久久噜噜噜久久中文字幕色伊伊 | 亚洲va在线va天堂| www激情久久| 在线日韩一区二区| 国产一区二区精品久久99| 亚洲日本在线观看| 日韩欧美中文一区二区| 91丨porny丨国产入口| 精品制服美女久久| 樱花草国产18久久久久| 国产喂奶挤奶一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 蜜臀久久久久久久| 亚洲男人天堂av网| 国产日本一区二区| 正在播放一区二区| 色综合久久综合中文综合网| 国产一区欧美二区| 午夜精品久久久久影视| 亚洲欧美日韩久久精品| 欧美精品一区二区在线播放 | 国产精品成人免费在线| 精品国内片67194| 欧美日韩在线播| av在线这里只有精品| 精品在线免费观看| 午夜精品福利一区二区三区av | 国产精品视频一二三| 欧美一二三区在线观看| 在线国产亚洲欧美| 成人高清免费在线播放| 久久机这里只有精品| 亚洲gay无套男同| 亚洲自拍偷拍综合| 中文字幕一区二区不卡| 日本一区二区三区久久久久久久久不| 日韩欧美高清一区| 欧美日韩视频专区在线播放| 日本电影欧美片| 97久久精品人人做人人爽| 成人性生交大片免费看视频在线| 国模一区二区三区白浆| 久久国产视频网| 免费观看一级欧美片| 午夜久久久久久| 亚洲午夜免费福利视频| 亚洲精品日产精品乱码不卡| 综合久久综合久久| 国产精品不卡视频| 国产精品欧美一级免费| 国产日韩欧美一区二区三区乱码| 久久免费视频一区| 久久久一区二区| 久久精品免视看|