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

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

?? isopnp.c

?? Pc板與DNW的USB驅動
?? 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;

    //
    // 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"));
            IoSkipCurrentIrpStackLocation (Irp);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美嫩在线观看| 精品久久一区二区三区| 欧美视频中文一区二区三区在线观看| 欧美精品在线一区二区| 久久久综合精品| 亚洲一区二区三区四区在线| 国产不卡视频在线播放| 91麻豆精品国产自产在线| 中文字幕在线不卡一区二区三区| 久久精品国产在热久久| 欧美日韩国产精选| 日韩一区有码在线| 高清久久久久久| 精品国产三级a在线观看| 午夜免费久久看| 91一区一区三区| 亚洲国产高清aⅴ视频| 九九在线精品视频| 91精品国产黑色紧身裤美女| 亚洲综合激情另类小说区| 成人黄色小视频| 精品国产电影一区二区| 三级亚洲高清视频| 欧美日韩1234| 日韩精品欧美精品| 欧美日韩精品一二三区| 亚洲二区在线视频| 欧美日韩在线亚洲一区蜜芽| 亚洲一区中文日韩| 欧美日韩一区二区三区在线看| 亚洲免费av在线| 色综合久久久久综合99| 亚洲三级在线观看| 91首页免费视频| 亚洲另类在线制服丝袜| 日本道精品一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 99热精品国产| 亚洲人成网站在线| 欧美影片第一页| 亚洲成人免费观看| 91精品国产色综合久久ai换脸| 日韩专区一卡二卡| 精品国产一区二区三区四区四| 国产久卡久卡久卡久卡视频精品| 国产亚洲制服色| 成人国产精品免费观看动漫| 国产精品美女一区二区在线观看| 成人午夜私人影院| 亚洲免费观看高清完整| 欧美日本不卡视频| 捆绑紧缚一区二区三区视频 | 99精品欧美一区| 亚洲色图第一区| 欧美美女网站色| 麻豆精品新av中文字幕| 国产情人综合久久777777| 97久久精品人人爽人人爽蜜臀| 亚洲综合小说图片| 欧美电影免费观看完整版| 国产精品一区二区三区乱码| 亚洲老妇xxxxxx| 91精品国产麻豆国产自产在线 | 亚洲妇熟xx妇色黄| 日韩区在线观看| 成人精品视频一区二区三区尤物| 亚洲人成7777| 精品剧情v国产在线观看在线| 高清视频一区二区| 亚洲成av人在线观看| 久久夜色精品国产欧美乱极品| a4yy欧美一区二区三区| 日韩精品色哟哟| **欧美大码日韩| 日韩美女一区二区三区四区| 成人激情电影免费在线观看| 日韩精品91亚洲二区在线观看| 久久精品欧美一区二区三区麻豆| 在线视频欧美区| 国产一区二区福利视频| 亚洲午夜久久久久中文字幕久| 久久青草国产手机看片福利盒子| 色婷婷综合视频在线观看| 老色鬼精品视频在线观看播放| 亚洲美腿欧美偷拍| 久久久亚洲精华液精华液精华液| 欧美丝袜丝交足nylons| 成人福利视频网站| 国内精品国产成人国产三级粉色| 一区二区三区四区国产精品| 国产婷婷精品av在线| 337p亚洲精品色噜噜狠狠| 91农村精品一区二区在线| 激情偷乱视频一区二区三区| 亚洲国产欧美在线| 综合久久久久久| 国产午夜一区二区三区| 日韩欧美一区电影| 51精品国自产在线| 欧美性猛交xxxx乱大交退制版 | 日本三级亚洲精品| 一区二区视频免费在线观看| 国产精品国产三级国产普通话三级| 日韩欧美久久久| 欧美一区二区三区四区久久| 欧美系列一区二区| 色天天综合久久久久综合片| 99久久免费国产| 99国产精品99久久久久久| 懂色av一区二区三区免费观看| 国产乱对白刺激视频不卡| 国产一区视频在线看| 捆绑紧缚一区二区三区视频 | 樱桃视频在线观看一区| 亚洲同性同志一二三专区| 国产精品福利av| 中文字幕一区二区三区不卡 | 亚洲图片有声小说| 亚洲一区二区三区国产| 亚洲一二三区在线观看| 亚洲国产欧美另类丝袜| 亚洲国产精品一区二区久久恐怖片| 亚洲综合在线第一页| 偷窥国产亚洲免费视频| 秋霞电影一区二区| 久久成人免费网站| 国产精品亚洲午夜一区二区三区| 成人免费视频网站在线观看| 99精品一区二区三区| 色婷婷久久久久swag精品| 欧美日韩欧美一区二区| 日韩欧美一级二级| 久久久精品免费免费| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 一区二区久久久久久| 无吗不卡中文字幕| 国产一区二三区好的| 成人丝袜18视频在线观看| 色综合久久中文字幕| 欧美日韩三级一区| 精品国产sm最大网站| 国产精品麻豆久久久| 亚洲一区二区视频| 精品一区二区三区视频| 波多野结衣精品在线| 欧美日韩aaa| 欧美激情一区二区在线| 亚洲午夜久久久久中文字幕久| 日韩中文字幕av电影| 国产成人精品亚洲午夜麻豆| 欧美综合一区二区三区| 久久亚洲一级片| 亚洲午夜一区二区| 国产美女一区二区| 欧美伊人久久大香线蕉综合69 | 色综合天天综合网国产成人综合天| 久久精品夜色噜噜亚洲a∨| 国产精品人妖ts系列视频| 亚洲一区二区视频在线观看| 国产曰批免费观看久久久| 色综合久久中文综合久久牛| 精品国产一区二区三区四区四| 亚洲乱码国产乱码精品精98午夜| 久久er精品视频| 欧美日韩情趣电影| 国产精品色呦呦| 日韩高清不卡一区| 中文天堂在线一区| 日韩高清一区二区| 色综合久久久久综合99| 久久亚洲二区三区| 日韩av一区二区三区四区| 91亚洲精品久久久蜜桃网站| 欧美精品一区二区三区在线| 午夜精品成人在线| 91国偷自产一区二区三区观看 | 在线综合+亚洲+欧美中文字幕| 国产精品国产三级国产| 精品在线播放免费| 欧美一区二区三区四区高清| 一区二区高清视频在线观看| 成人免费看片app下载| 亚洲精品在线观| 免费在线看成人av| 欧美三电影在线| 亚洲另类在线视频| 91在线视频在线| 中文字幕国产一区| 国产成人超碰人人澡人人澡| 精品国精品自拍自在线| 日韩电影免费在线看| 欧美精品久久99| 午夜精品福利久久久| 欧美日韩久久一区| 视频一区免费在线观看| 在线播放中文字幕一区| 天堂一区二区在线免费观看| 欧美午夜精品久久久久久孕妇| 亚洲综合在线视频| 欧美日韩久久一区|