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

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

?? isopnp.c

?? USB技術(shù)大全-54.8M.zip
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
	/*++

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"));

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久成人18免费观看| 在线日韩一区二区| 国产一区二区三区视频在线播放| 肉丝袜脚交视频一区二区| 亚洲综合视频在线观看| 亚洲一线二线三线视频| 亚洲亚洲精品在线观看| 亚洲午夜久久久久久久久电影网| 亚洲午夜电影在线观看| 午夜影视日本亚洲欧洲精品| 日韩电影一二三区| 奇米一区二区三区| 国产精品一区在线观看乱码| 国产成人精品三级麻豆| av电影一区二区| 色噜噜久久综合| 欧美日韩精品福利| 日韩欧美国产一二三区| 精品国产乱码久久久久久影片| 精品国产伦一区二区三区观看体验| 国产午夜精品福利| 国产精品国产自产拍高清av王其| 中文字幕五月欧美| 亚洲综合成人在线| 日韩 欧美一区二区三区| 激情五月播播久久久精品| 黄网站免费久久| 成人成人成人在线视频| 色综合中文综合网| 精品国产乱码久久久久久久久| 91精品国产色综合久久ai换脸| 日韩欧美一区二区视频| 久久久影院官网| 国产精品国产三级国产a| 一区2区3区在线看| 看电影不卡的网站| jizzjizzjizz欧美| 欧美视频自拍偷拍| 日韩一级免费观看| 久久精品视频在线看| 亚洲三级小视频| 日韩 欧美一区二区三区| 国产成人免费在线视频| 色香蕉成人二区免费| 6080午夜不卡| 国产精品女上位| 午夜视频一区在线观看| 国产资源精品在线观看| 91蜜桃传媒精品久久久一区二区| 欧美久久久久久久久| 欧美激情综合在线| 香蕉加勒比综合久久| 国产成a人亚洲| 欧美色电影在线| 国产欧美视频在线观看| 无吗不卡中文字幕| 成人一道本在线| 欧美一区二区三区在线视频| 国产精品国产自产拍高清av王其| 蜜臀久久久久久久| 91在线看国产| 欧美精品一区视频| 亚洲成在人线免费| 不卡av电影在线播放| 欧美成人女星排名| 亚洲宅男天堂在线观看无病毒| 激情深爱一区二区| 欧美日韩亚洲不卡| 日韩美女视频19| 国产精品99久| 日韩亚洲欧美中文三级| 一区二区三区国产| 国产成人免费视频网站| 日韩一区二区三区视频在线观看| 亚洲精品视频在线观看网站| 国产精品一区二区果冻传媒| 制服丝袜亚洲网站| 亚洲精品乱码久久久久久久久 | 日本道色综合久久| 久久久精品人体av艺术| 日韩激情视频网站| 欧美伊人久久大香线蕉综合69| 中文子幕无线码一区tr| 国产最新精品精品你懂的| 欧美日韩精品一区二区三区四区 | 精品噜噜噜噜久久久久久久久试看| 一区二区三区在线看| 波多野结衣中文字幕一区| 26uuu精品一区二区三区四区在线| 日日摸夜夜添夜夜添精品视频 | 亚洲色图在线看| 国产iv一区二区三区| 精品国产网站在线观看| 日本成人在线网站| 欧美福利视频导航| 天堂一区二区在线| 欧美三级资源在线| 一区二区三区精密机械公司| 91视视频在线观看入口直接观看www | 国产精品嫩草99a| 国产毛片精品国产一区二区三区| 884aa四虎影成人精品一区| 亚洲综合无码一区二区| 在线精品视频免费观看| 亚洲综合久久av| 欧美日韩美女一区二区| 亚洲综合在线免费观看| 97久久久精品综合88久久| 国产精品久久国产精麻豆99网站| 国产91精品一区二区麻豆亚洲| 国产拍揄自揄精品视频麻豆| 国产精品99久久久久久久vr| 久久久久久99久久久精品网站| 精品一区二区三区在线视频| 精品久久久久一区二区国产| 国产一区二区福利| 久久久国产综合精品女国产盗摄| 成人一区二区视频| 中文字幕一区二区在线观看| 色婷婷狠狠综合| 丁香一区二区三区| 国产精品免费视频观看| 91啪亚洲精品| 亚洲高清一区二区三区| 日韩三级视频在线看| 精品在线你懂的| 久久久久久久久久久久久久久99 | 国产欧美精品国产国产专区| 国产高清成人在线| 18成人在线观看| 欧美在线观看一区二区| 日本欧美久久久久免费播放网| 久久丝袜美腿综合| 波多野结衣中文字幕一区二区三区| 一个色综合网站| 日韩一区二区三区电影在线观看| 国产精品自拍av| 亚洲色图.com| 欧美一区日韩一区| 国产成人精品影视| 亚洲美女视频在线| 日韩一区二区三区视频在线观看| 国产不卡视频一区| 亚洲午夜久久久| 久久久噜噜噜久久中文字幕色伊伊| 99re成人精品视频| 日本中文字幕一区| 中日韩av电影| 欧美日韩精品久久久| 国产suv精品一区二区三区| 亚洲亚洲人成综合网络| 久久婷婷成人综合色| 91国产精品成人| 国产一区二区h| 亚洲成人www| 久久精品免费在线观看| 欧美日韩国产在线观看| 国产91精品欧美| 欧美a级理论片| 亚洲天堂福利av| 精品日韩欧美在线| 色婷婷久久99综合精品jk白丝 | 欧美一区二区三区四区久久| 国产精品综合二区| 亚洲二区在线视频| 国产精品久久久久久久蜜臀| 欧美一区二区三区人| 99精品偷自拍| 国产一二三精品| 亚洲成av人片在线| 亚洲色图欧美在线| 久久亚洲综合色| 欧美福利一区二区| 在线视频一区二区三| 成人免费看的视频| 久久精品国产99国产| 亚洲成a人v欧美综合天堂| 中文字幕亚洲一区二区av在线| 久久免费偷拍视频| 欧美一区二区观看视频| 在线观看www91| gogo大胆日本视频一区| 国产精品一卡二| 久久国产成人午夜av影院| 亚洲一区二区成人在线观看| 国产精品久久久久久久久图文区 | 蜜臀久久久99精品久久久久久| 亚洲黄色小视频| 成人免费在线观看入口| 久久久久久97三级| 精品免费99久久| 欧美一级国产精品| 欧美精品三级日韩久久| 欧美在线播放高清精品| 91在线观看成人| av网站免费线看精品| 成人午夜视频网站| 国产精品资源网| 国产精品一区二区x88av| 狠狠色伊人亚洲综合成人|