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

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

?? isopnp.c

?? Appliction => rs232測試 應用程式 Driver => usb to rs232 驅動程式(wdm ddk) DLL => 應用程式 Firmware =&g
?? 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一区二区三区免费野_久草精品视频
亚洲免费视频成人| 成人av在线网| 亚洲伦在线观看| 亚洲国产激情av| 久久综合色婷婷| 精品久久久久香蕉网| 欧美一区二区三区在线电影| 555夜色666亚洲国产免| 欧美日韩国产免费| 在线成人高清不卡| 欧美一区二区三区在线观看视频 | 在线播放91灌醉迷j高跟美女| 91小视频在线免费看| fc2成人免费人成在线观看播放| 国产成人亚洲精品狼色在线| 国产呦萝稀缺另类资源| 国产精品一区在线观看你懂的| 国产伦精品一区二区三区免费 | 欧美国产丝袜视频| 国产精品视频一二三区| 国产精品萝li| 亚洲一区二区三区在线播放| 亚洲成av人片在线观看无码| 久久国产精品区| 国产99久久久精品| 色av综合在线| 日韩视频一区二区在线观看| 久久蜜臀精品av| 亚洲丝袜美腿综合| 蜜桃视频免费观看一区| 国产白丝精品91爽爽久久| 91黄色免费看| 精品日韩在线观看| 亚洲欧洲精品天堂一级 | 免费高清成人在线| 国产成人免费9x9x人网站视频| 99视频精品全部免费在线| 欧美日韩综合在线免费观看| 日韩欧美国产综合| 亚洲色图另类专区| 免费在线观看精品| 99re视频精品| 日韩欧美国产三级| 一区二区三区在线不卡| 精品一区二区在线观看| 色综合色狠狠综合色| 日韩欧美在线网站| 一区二区三区四区高清精品免费观看 | 91小视频在线观看| 7777女厕盗摄久久久| 日本一二三不卡| 国产成+人+日韩+欧美+亚洲| 欧美影视一区二区三区| 欧美精品一区二区三区高清aⅴ | 国产一区二区在线视频| 色88888久久久久久影院按摩| 欧美一二区视频| 一区二区三区中文字幕电影| 国产成人精品免费| 欧美一区二区三级| 亚洲成人资源网| 99re8在线精品视频免费播放| 欧美综合亚洲图片综合区| 欧美亚洲国产怡红院影院| 精品福利一区二区三区免费视频| 亚洲综合久久久| 色哟哟国产精品| 久久欧美一区二区| 久久精品理论片| 91精品久久久久久蜜臀| 亚洲电影中文字幕在线观看| 96av麻豆蜜桃一区二区| 国产精品久久国产精麻豆99网站| 国产精品原创巨作av| 欧美成人伊人久久综合网| 天天影视涩香欲综合网| 欧美嫩在线观看| 三级欧美在线一区| 欧美唯美清纯偷拍| 亚洲国产一区二区视频| 欧美色窝79yyyycom| 一区二区欧美精品| 欧美日韩一区成人| 污片在线观看一区二区| 欧美性感一区二区三区| 亚洲国产精品天堂| 69精品人人人人| 麻豆精品在线播放| 精品av久久707| 国产成人免费高清| 国产精品网友自拍| 色婷婷av一区二区三区大白胸 | 综合电影一区二区三区 | 色综合久久久久综合99| 亚洲一区在线免费观看| 欧美日韩aaaaaa| 久久国产婷婷国产香蕉| 久久久国产午夜精品| 不卡在线观看av| 亚洲香蕉伊在人在线观| 欧美一区二区啪啪| 高清不卡在线观看av| 国产精品国产三级国产aⅴ无密码| 波多野结衣中文字幕一区二区三区 | 日本高清不卡视频| 午夜欧美电影在线观看| 精品久久免费看| 成人爽a毛片一区二区免费| 亚洲欧美日韩国产综合在线| 8x8x8国产精品| 成人亚洲一区二区一| 亚洲国产精品自拍| 久久久精品综合| 欧日韩精品视频| 国产综合一区二区| 一区二区三区av电影| 精品国产sm最大网站| 一本久道中文字幕精品亚洲嫩| 日韩中文字幕91| 中文字幕在线免费不卡| 欧美一级电影网站| 97久久精品人人做人人爽| 全国精品久久少妇| 亚洲日本丝袜连裤袜办公室| 日韩欧美精品在线| 在线日韩一区二区| 高清免费成人av| 热久久一区二区| 亚洲国产一区二区a毛片| 久久蜜桃一区二区| 欧美性生活影院| 欧美一区二区视频网站| 国产精品一二三在| 欧美日韩一区二区不卡| 国产精品福利电影一区二区三区四区| 日韩在线观看一区二区| 日韩三级视频中文字幕| 成人午夜电影网站| 国产在线日韩欧美| 日日嗨av一区二区三区四区| 国产精品成人免费在线| 精品日韩99亚洲| 欧美日韩一区二区三区视频| caoporm超碰国产精品| 国产乱码精品一区二区三区av| 日韩国产成人精品| 亚洲在线一区二区三区| 国产精品久久久久影院亚瑟| 久久久蜜臀国产一区二区| 91精品国产色综合久久不卡电影| 91九色02白丝porn| 日本道精品一区二区三区 | 欧美日韩精品一区二区三区| 97精品久久久久中文字幕 | 91在线免费视频观看| 国产成人av一区二区三区在线 | 亚洲免费观看高清完整版在线观看 | 三级一区在线视频先锋| 亚洲一区在线观看网站| 一区二区三区加勒比av| 亚洲精品伦理在线| 亚洲欧美欧美一区二区三区| 国产精品网站一区| 自拍偷拍国产精品| 一区二区三区四区视频精品免费| ...xxx性欧美| 一区二区三区在线视频观看58| 亚洲蜜桃精久久久久久久| 一区二区在线免费| 亚洲成av人片在线观看无码| 亚洲国产精品精华液网站| 日韩精品三区四区| 久久99精品国产| 成人夜色视频网站在线观看| 99精品欧美一区二区三区综合在线| 99久久精品免费精品国产| 91黄色激情网站| 欧美一级国产精品| 亚洲精品一线二线三线| 欧美国产欧美亚州国产日韩mv天天看完整| 国产欧美一区二区精品性色超碰| 国产精品久线观看视频| 亚洲最新在线观看| 久久精品二区亚洲w码| 成人毛片视频在线观看| 在线视频你懂得一区二区三区| 538在线一区二区精品国产| 久久综合色婷婷| 亚洲理论在线观看| 日韩电影免费在线观看网站| 国产乱码字幕精品高清av| 在线视频观看一区| 久久无码av三级| 一区二区三区91| 国产一区二区三区免费| 欧美优质美女网站| 久久久亚洲国产美女国产盗摄 | 亚洲国产日韩在线一区模特| 久久国产生活片100| 色94色欧美sute亚洲13|