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

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

?? isopnp.c

?? 這是ARM9開發板上自帶的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一区二区三区免费野_久草精品视频
一区二区三区不卡在线观看| 亚洲一级二级在线| 欧美亚洲综合色| 成人免费观看男女羞羞视频| 韩国女主播一区| 国产一区二区三区免费观看| 精品一区二区免费在线观看| 日韩高清在线不卡| 蜜臀久久99精品久久久画质超高清| 首页综合国产亚洲丝袜| 午夜成人免费视频| 麻豆国产91在线播放| 久久99精品国产| 国产又粗又猛又爽又黄91精品| 国产一区视频导航| 国产精品一区二区三区99| 国产成a人无v码亚洲福利| 粉嫩一区二区三区性色av| aaa亚洲精品一二三区| 国产成人三级在线观看| 国产精品视频看| 色噜噜夜夜夜综合网| 91蝌蚪porny成人天涯| 欧洲一区在线电影| 制服.丝袜.亚洲.另类.中文| 欧美一区二区久久| 久久精品人人爽人人爽| 亚洲欧洲美洲综合色网| 亚洲成人自拍偷拍| 国产精品白丝av| 94-欧美-setu| 日韩视频在线观看一区二区| 久久久欧美精品sm网站| 亚洲欧美一区二区视频| 午夜视频在线观看一区二区| 国产一区二区三区精品欧美日韩一区二区三区| 国产精品中文字幕日韩精品 | 国产高清无密码一区二区三区| 豆国产96在线|亚洲| 欧美日韩视频专区在线播放| 久久综合丝袜日本网| 亚洲狠狠丁香婷婷综合久久久| 日韩精品高清不卡| 成人a区在线观看| 欧美一区二区黄色| 亚洲视频一二三区| 激情综合色综合久久| 国产免费久久精品| 日韩高清一区在线| heyzo一本久久综合| 国产高清亚洲一区| 一本大道av一区二区在线播放| 欧美日韩国产欧美日美国产精品| 精品99一区二区三区| 午夜精品久久一牛影视| 成人免费福利片| 欧美va亚洲va香蕉在线| 亚洲一区二区三区爽爽爽爽爽| 国产美女av一区二区三区| 欧美亚洲高清一区二区三区不卡| 久久精品在这里| 午夜久久久久久久久| 六月丁香婷婷色狠狠久久| 欧美一级片在线| 欧美激情在线免费观看| 麻豆精品在线观看| 九九热在线视频观看这里只有精品| 精品制服美女丁香| 8v天堂国产在线一区二区| 成人欧美一区二区三区| 国产麻豆成人精品| wwww国产精品欧美| 久久成人18免费观看| 欧美精品久久天天躁| 亚洲视频在线观看三级| kk眼镜猥琐国模调教系列一区二区| 精品对白一区国产伦| 日韩电影网1区2区| 欧美一区二区黄| 性欧美疯狂xxxxbbbb| 欧美人xxxx| 午夜精品久久久久久久久久| 欧美视频精品在线| 亚洲一区二区三区四区的| 99久久婷婷国产综合精品 | 久久精品欧美一区二区三区不卡 | 蜜臀精品一区二区三区在线观看| 91久久人澡人人添人人爽欧美| 中文字幕视频一区二区三区久| 国产高清精品网站| 国产欧美精品一区二区色综合朱莉| 韩国毛片一区二区三区| 久久精品亚洲麻豆av一区二区 | 久久综合视频网| 国产精品综合av一区二区国产馆| 国产欧美在线观看一区| 国产91丝袜在线观看| 国产精品国产三级国产aⅴ入口| 成人综合婷婷国产精品久久蜜臀 | 97se亚洲国产综合自在线观| 综合欧美亚洲日本| 欧美三级一区二区| 国内精品国产成人| 精品中文字幕一区二区| 欧美日韩一区在线观看| 日韩有码一区二区三区| 精品国产伦一区二区三区观看体验| 国产一区二区按摩在线观看| 亚洲国产激情av| 欧美亚洲国产一区二区三区| 青草av.久久免费一区| 久久天堂av综合合色蜜桃网| 99在线精品观看| 午夜精品123| 国产亚洲成aⅴ人片在线观看| 91亚洲精品久久久蜜桃| 首页国产欧美久久| 国产拍揄自揄精品视频麻豆| 欧美色欧美亚洲另类二区| 免费国产亚洲视频| 亚洲桃色在线一区| 欧美精品一区二区三区一线天视频| 成人免费高清在线| 看电影不卡的网站| 久久综合久久鬼色中文字| 风流少妇一区二区| 国产欧美日本一区视频| 91精品国产aⅴ一区二区| 国产精品18久久久久久vr| 欧美一区二区三区系列电影| 国产精品一区二区久久精品爱涩 | 日韩电影免费在线看| 国产精品午夜春色av| 欧美日韩一区二区三区在线看| 国产成人av在线影院| 石原莉奈在线亚洲二区| 亚洲码国产岛国毛片在线| 欧美成人一级视频| 欧美日韩dvd在线观看| 成人国产精品免费观看动漫| 久久69国产一区二区蜜臀| 一区二区三区高清| 国产精品久久久久久久久果冻传媒| 在线电影国产精品| 欧美在线小视频| 亚洲色图制服丝袜| 亚洲欧美另类综合偷拍| 欧美性猛片xxxx免费看久爱| 丁香五精品蜜臀久久久久99网站| 麻豆国产精品官网| 日韩国产欧美三级| 午夜视频一区二区| 亚洲高清一区二区三区| 亚洲色图制服丝袜| 亚洲精品免费视频| 18成人在线视频| 自拍偷在线精品自拍偷无码专区| 久久久天堂av| 中文字幕亚洲在| 国产精品久久久久桃色tv| 国产校园另类小说区| 337p日本欧洲亚洲大胆精品 | 婷婷夜色潮精品综合在线| 一区二区三区四区高清精品免费观看| 国产精品乱人伦中文| 欧美国产精品久久| 中文字幕一区在线| 亚洲色图欧洲色图| 国产精品久久看| 久久成人免费电影| 日韩免费视频线观看| 国产伦精一区二区三区| 国产一区二区在线观看免费| 国产一区二区三区在线看麻豆| 国产精品综合一区二区三区| 国产一区二区三区四区五区入口| 国产露脸91国语对白| 91丝袜高跟美女视频| 91视频一区二区| 欧美精品一卡二卡| 精品99一区二区三区| 国产精品乱人伦中文| 一二三四社区欧美黄| 奇米精品一区二区三区四区| 国产剧情一区在线| 欧美中文一区二区三区| 日韩一级成人av| 国产色婷婷亚洲99精品小说| 亚洲男人的天堂在线aⅴ视频| 午夜免费欧美电影| 国产一区二区久久| 在线亚洲一区二区| 欧美成人性战久久| 亚洲日本在线a| 日韩av中文在线观看| 亚洲国产cao| www.欧美色图| 欧美videossexotv100| 国产欧美日韩另类视频免费观看 | 国产一区二区在线电影|