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

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

?? ezusbsys.c

?? cy7c68013usbdriver驅動程序,非常方便
?? C
?? 第 1 頁 / 共 5 頁
字號:
   } // if ntStatus is PENDING

   goto Ezusb_Dispatch_Done;
            
Ezusb_Dispatch_Done:

   Ezusb_KdPrint (("Exit Ezusb_DispatchPower %x\n", ntStatus));
   return ntStatus;

}//Ezusb_DispatchPower


VOID
Ezusb_Unload(
    IN PDRIVER_OBJECT DriverObject
    )
/*++
Routine Description:
    Free all the allocated resources, etc.
    TODO: This is a placeholder for driver writer to add code on unload

Arguments:
    DriverObject - pointer to a driver object

Return Value:
    None
--*/
{
    Ezusb_KdPrint (("enter Ezusb_Unload\n"));
    /*
    // TODO: Free any global resources allocated in DriverEntry
    */
    Ezusb_KdPrint (("exit Ezusb_Unload\n"));
}

NTSTATUS
Ezusb_HandleRemoveDevice(
   IN PDEVICE_OBJECT fdo,
   IN PIRP Irp
   )
{
   NTSTATUS ntStatus;
   PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
   ULONG i;

   // set the removing flag to prevent any new I/O's
   pdx->removing = TRUE;

   // brute force - send an abort pipe message to all pipes to cancel any
   // pending transfers.  this should solve the problem of the driver blocking
   // on a REMOVE message because there is a pending transfer.
   for (i = 0; i < pdx->Interface->NumberOfPipes; i++)
   {
      Ezusb_AbortPipe(fdo,(USBD_PIPE_HANDLE) pdx->Interface->Pipes[i].PipeHandle);
   }

   UnlockDevice(fdo);			// once for LockDevice at start of dispatch
   UnlockDevice(fdo);			// once for initialization during AddDevice
   KeWaitForSingleObject(&pdx->evRemove, Executive, KernelMode, FALSE, NULL);

	Ezusb_RemoveDevice(fdo);

   ntStatus = Ezusb_DefaultPnpHandler(fdo, Irp);

   return ntStatus;				// lower-level completed IoStatus already

}


NTSTATUS
Ezusb_HandleStartDevice(
   IN PDEVICE_OBJECT fdo,
   IN PIRP Irp
   )
{
   NTSTATUS ntStatus;

   //
   // First let all lower-level drivers handle this request.
   //
   ntStatus = ForwardAndWait(fdo, Irp);
	if (!NT_SUCCESS(ntStatus))
		return CompleteRequest(Irp, ntStatus, Irp->IoStatus.Information);

   //
   // now do whatever we need to do to start the device
   //
   ntStatus = Ezusb_StartDevice(fdo);

	return CompleteRequest(Irp, ntStatus, 0);
}

NTSTATUS
Ezusb_StartDevice(
    IN  PDEVICE_OBJECT fdo
    )
/*++

Routine Description:
   Initializes a given instance of the Ezusb Device on the USB.

   Arguments:
      fdo - pointer to the device object for this instance of a
                      Ezusb Device

Return Value:
   NT status code
--*/
{
    PDEVICE_EXTENSION pdx;
    NTSTATUS ntStatus;
    PUSB_DEVICE_DESCRIPTOR deviceDescriptor = NULL;
    PURB urb;
    ULONG siz;

    Ezusb_KdPrint (("enter Ezusb_StartDevice\n"));

    pdx = fdo->DeviceExtension;
    pdx->NeedCleanup = TRUE;

    /*
    // Get some memory from then non paged pool (fixed, locked system memory)
    // for use by the USB Request Block (urb) for the specific USB Request we
    // will be performing below (a USB device request).
    */
    urb = ExAllocatePool( NonPagedPool,
                          sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST));

    if (urb) {

        siz = sizeof(USB_DEVICE_DESCRIPTOR);

        // Get some non paged memory for the device descriptor contents
        deviceDescriptor = ExAllocatePool(NonPagedPool,
                                          siz);

        if (deviceDescriptor) {

            // Use a macro in the standard USB header files to build the URB
            UsbBuildGetDescriptorRequest(urb,
                                         (USHORT) sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST),
                                         USB_DEVICE_DESCRIPTOR_TYPE,
                                         0,
                                         0,
                                         deviceDescriptor,
                                         NULL,
                                         siz,
                                         NULL);

            // Get the device descriptor
            ntStatus = Ezusb_CallUSBD(fdo, urb);

            // Dump out the descriptor info to the debugger
            if (NT_SUCCESS(ntStatus)) {
                Ezusb_KdPrint (("Device Descriptor = %x, len %x\n",
                                deviceDescriptor,
                                urb->UrbControlDescriptorRequest.TransferBufferLength));

                Ezusb_KdPrint (("Ezusb Device Descriptor:\n"));
                Ezusb_KdPrint (("-------------------------\n"));
                Ezusb_KdPrint (("bLength %d\n", deviceDescriptor->bLength));
                Ezusb_KdPrint (("bDescriptorType 0x%x\n", deviceDescriptor->bDescriptorType));
                Ezusb_KdPrint (("bcdUSB 0x%x\n", deviceDescriptor->bcdUSB));
                Ezusb_KdPrint (("bDeviceClass 0x%x\n", deviceDescriptor->bDeviceClass));
                Ezusb_KdPrint (("bDeviceSubClass 0x%x\n", deviceDescriptor->bDeviceSubClass));
                Ezusb_KdPrint (("bDeviceProtocol 0x%x\n", deviceDescriptor->bDeviceProtocol));
                Ezusb_KdPrint (("bMaxPacketSize0 0x%x\n", deviceDescriptor->bMaxPacketSize0));
                Ezusb_KdPrint (("idVendor 0x%x\n", deviceDescriptor->idVendor));
                Ezusb_KdPrint (("idProduct 0x%x\n", deviceDescriptor->idProduct));
                Ezusb_KdPrint (("bcdDevice 0x%x\n", deviceDescriptor->bcdDevice));
                Ezusb_KdPrint (("iManufacturer 0x%x\n", deviceDescriptor->iManufacturer));
                Ezusb_KdPrint (("iProduct 0x%x\n", deviceDescriptor->iProduct));
                Ezusb_KdPrint (("iSerialNumber 0x%x\n", deviceDescriptor->iSerialNumber));
                Ezusb_KdPrint (("bNumConfigurations 0x%x\n", deviceDescriptor->bNumConfigurations));
            }
        } else {
            ntStatus = STATUS_NO_MEMORY;
        }

        if (NT_SUCCESS(ntStatus)) {
            /*
            // Put a ptr to the device descriptor in the device extension for easy
            // access (like a "cached" copy).  We will free this memory when the
            // device is removed.  See the "Ezusb_RemoveDevice" code.
            */
            pdx->DeviceDescriptor = deviceDescriptor;
            pdx->Stopped = FALSE;
        } else if (deviceDescriptor) {
            /*
            // If the bus transaction failed, then free up the memory created to hold
            // the device descriptor, since the device is probably non-functional
            */
            ExFreePool(deviceDescriptor);
            pdx->DeviceDescriptor = NULL;
        }

        ExFreePool(urb);

    } else {
        // Failed getting memory for the Urb 
        ntStatus = STATUS_NO_MEMORY;
    }

    // If the Get_Descriptor call was successful, then configure the device.
    if (NT_SUCCESS(ntStatus)) {
        ntStatus = Ezusb_ConfigureDevice(fdo);
    }

#ifdef DOWNLOAD_KEIL_MONITOR
   //
   // download the Keil monitor
   //

   //
   // First download loader firmware.  The loader firmware implements a vendor
   // specific command that will allow us to anchor load to external ram
   //
   Ezusb_8051Reset(fdo,1);
   Ezusb_DownloadIntelHex(fdo,loader);
   Ezusb_8051Reset(fdo,0);

   //
   // Now download the Keil Monitor
   //
   if (IsFx2(fdo))
   {
      Ezusb_KdPrint (("**** Downloading FX2 monitor\n"));
      Ezusb_DownloadIntelHex(fdo,mon_ext_sio1_fx2);
   }
   else
   {
      Ezusb_KdPrint (("**** Downloading EZ-USB monitor\n"));
      Ezusb_DownloadIntelHex(fdo,mon_ext_sio1_ezusb);
   }

   Ezusb_8051Reset(fdo,1);
   Ezusb_8051Reset(fdo,0);

#endif // if DOWNLOAD_KEIL_MONITOR

    Ezusb_KdPrint (("exit Ezusb_StartDevice (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
Ezusb_RemoveDevice(
    IN  PDEVICE_OBJECT fdo
    )
/*++

Routine Description:
    Removes a given instance of a Ezusb Device device on the USB.

Arguments:
    fdo - pointer to the device object for this instance of a Ezusb Device

Return Value:
    NT status code

--*/
{
   PDEVICE_EXTENSION pdx;
   NTSTATUS ntStatus = STATUS_SUCCESS;

   Ezusb_KdPrint (("enter Ezusb_RemoveDevice\n"));

   pdx = fdo->DeviceExtension;

   if (pdx->DeviceDescriptor)
   {
      ExFreePool(pdx->DeviceDescriptor);
   }

   //
   // Free up any interface structures in our device extension
   //
   if (pdx->Interface != NULL)
   {
      ExFreePool(pdx->Interface);
   }

   //
   // remove the device object's symbolic link
   //
   if (pdx->NeedCleanup)
   {
      UNICODE_STRING deviceLinkUnicodeString;

      pdx->NeedCleanup = FALSE;

      RtlInitUnicodeString (&deviceLinkUnicodeString,
                           pdx->DeviceLinkNameBuffer);

      IoDeleteSymbolicLink(&deviceLinkUnicodeString);
    }

   IoDetachDevice(pdx->StackDeviceObject);

   IoDeleteDevice (fdo);

   Ezusb_KdPrint (("exit Ezusb_RemoveDevice (%x)\n", ntStatus));

   return ntStatus;
}


NTSTATUS
Ezusb_StopDevice(
   IN  PDEVICE_OBJECT fdo
   )
/*++
Routine Description:
   Stops a given instance of a Ezusb Device device on USB.

Arguments:
   fdo - pointer to the device object for this instance of a Ezusb Device

Return Value:
   NT status code

  --*/
{
   PDEVICE_EXTENSION pdx;
   NTSTATUS ntStatus = STATUS_SUCCESS;
   PURB urb;
   ULONG siz;

   Ezusb_KdPrint (("enter Ezusb_StopDevice\n"));

   pdx = fdo->DeviceExtension;

   //
   // 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.
   //

   siz = sizeof(struct _URB_SELECT_CONFIGURATION);

   urb = ExAllocatePool(NonPagedPool,
                      siz);

   if (urb)
   {
      NTSTATUS status;

      UsbBuildSelectConfigurationRequest(urb,
                                       (USHORT) siz,
                                       NULL);

      status = Ezusb_CallUSBD(fdo, urb);

      Ezusb_KdPrint (("Device Configuration Closed status = %x usb status = %x.\n",
                     status, urb->UrbHeader.Status));

      ExFreePool(urb);
   }
   else
   {
      ntStatus = STATUS_NO_MEMORY;
   }

   Ezusb_KdPrint (("exit Ezusb_StopDevice (%x)\n", ntStatus));

   return ntStatus;
}

NTSTATUS
Ezusb_PnPAddDevice(
    IN PDRIVER_OBJECT DriverObject,
    IN PDEVICE_OBJECT PhysicalDeviceObject
    )
/*++
Routine Description:
    This routine is called to create a new instance of the device

Arguments:
    DriverObject - pointer to the driver object for this instance of Ezusb
    PhysicalDeviceObject - pointer to a device object created by the bus

Return Value:
    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/
{
   NTSTATUS                ntStatus = STATUS_SUCCESS;
   PDEVICE_OBJECT          deviceObject = NULL;
   PDEVICE_EXTENSION       pdx;
   int instance;

   Ezusb_KdPrint(("enter Ezusb_PnPAddDevice\n"));

#define MAX_EZUSB_DEVICES 8

   //
   // create our functional device object (FDO).  This driver supports multiple ezusb devices.
   // This loop will look for an available instance number.  Keep incrementing the instance
   // until a call to Ezusb_CreateDeviceObject succeeds.
   //
   instance = 0;
   do

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.欧美精品一二区| 欧美一区永久视频免费观看| 美女脱光内衣内裤视频久久网站 | 中文字幕在线不卡国产视频| 日韩一区二区视频在线观看| 欧美日韩1区2区| 欧美日韩一区二区三区四区五区| 91丨porny丨首页| 一本到不卡精品视频在线观看| 不卡一区二区三区四区| 成人av网站大全| 91小宝寻花一区二区三区| 99视频在线精品| 91麻豆高清视频| 欧美这里有精品| 欧美区一区二区三区| 欧美高清视频一二三区| 日韩欧美国产一区二区在线播放| 91精品国模一区二区三区| 日韩一区二区三区免费观看| 欧美精品一区二区精品网| 久久久久国产一区二区三区四区 | 欧美日韩国产高清一区二区三区 | 亚洲区小说区图片区qvod| 午夜激情久久久| 日韩avvvv在线播放| 国产尤物一区二区| 成人精品一区二区三区中文字幕| av午夜一区麻豆| 欧美性大战久久| 亚洲精品在线网站| 日韩毛片一二三区| 男女男精品视频网| 成人激情免费电影网址| 精品视频1区2区3区| 精品粉嫩超白一线天av| 亚洲丝袜精品丝袜在线| 美腿丝袜亚洲色图| 成人av在线网站| 6080国产精品一区二区| 国产日韩欧美制服另类| 一区二区三区日韩在线观看| 奇米影视一区二区三区| av综合在线播放| 日韩女优制服丝袜电影| 亚洲男同1069视频| 国产一区二区三区综合| 欧美日韩一区精品| 中文字幕一区二区日韩精品绯色| 视频一区在线播放| 91在线精品秘密一区二区| 日韩精品中文字幕一区二区三区 | 不卡av在线网| 日韩欧美色电影| 亚洲丝袜另类动漫二区| 国产精品伊人色| 日韩三区在线观看| 一区二区欧美精品| 成人国产亚洲欧美成人综合网 | 老色鬼精品视频在线观看播放| 99久久综合色| 国产性色一区二区| 狠狠狠色丁香婷婷综合激情| 91精品国产色综合久久不卡电影| 亚洲欧美视频一区| 波多野结衣亚洲一区| 亚洲精品一线二线三线| 美女网站色91| 制服丝袜中文字幕亚洲| 天天综合色天天| 欧美三级电影一区| 亚洲最大成人网4388xx| 99riav一区二区三区| 国产精品乱人伦中文| 国产91精品欧美| 国产日韩精品一区| 成人性生交大片免费| 国产精品免费av| thepron国产精品| 国产精品乱码人人做人人爱| 国产黄色成人av| 久久久精品人体av艺术| 国产成人在线视频网址| 欧美国产精品劲爆| 99久久精品免费| 亚洲激情av在线| 欧美视频中文字幕| 免费人成网站在线观看欧美高清| 91麻豆精品国产无毒不卡在线观看| 偷拍自拍另类欧美| 日韩精品一区国产麻豆| 国模娜娜一区二区三区| 国产午夜亚洲精品理论片色戒| 丁香婷婷综合五月| 一区二区三区四区精品在线视频 | 国产精品一二三四区| 久久精品视频一区二区三区| 成人一级片网址| 亚洲欧美激情一区二区| 欧美三级日本三级少妇99| 久热成人在线视频| 亚洲精品一区二区三区精华液 | 精品卡一卡二卡三卡四在线| 国产在线一区二区综合免费视频| 国产日韩高清在线| 欧美色综合天天久久综合精品| 日韩中文字幕不卡| 久久久www免费人成精品| 99精品久久99久久久久| 亚洲国产欧美在线| 久久亚洲私人国产精品va媚药| 不卡区在线中文字幕| 日韩成人午夜精品| 国产精品美女久久久久久2018 | 国内成人免费视频| 日韩一区在线播放| 日韩午夜在线影院| 成人av中文字幕| 人妖欧美一区二区| √…a在线天堂一区| 日韩一区二区三区在线视频| 91在线观看成人| 精品一区二区在线观看| 亚洲乱码国产乱码精品精98午夜 | 精品亚洲porn| 一区二区视频在线| 久久久国产精品不卡| 欧美日韩免费观看一区三区| 成人自拍视频在线观看| 日韩激情一区二区| 亚洲女人小视频在线观看| 久久久精品免费观看| 777亚洲妇女| 色综合天天在线| 国产精品 日产精品 欧美精品| 日韩国产精品久久| 亚洲欧美日韩中文播放| 国产女同性恋一区二区| 精品日韩欧美在线| 在线播放欧美女士性生活| 94-欧美-setu| 成人av网址在线观看| 国产精品一区在线| 老司机精品视频线观看86 | 久久新电视剧免费观看| 欧美日本韩国一区二区三区视频| 91色.com| 99久久99精品久久久久久| 国产成人综合在线播放| 久久精品国产一区二区| 免费观看91视频大全| 午夜在线成人av| 亚洲尤物在线视频观看| 最新高清无码专区| 国产精品美女久久久久高潮| 欧美国产欧美亚州国产日韩mv天天看完整| 777奇米成人网| 欧美精品九九99久久| 欧美剧情片在线观看| 91精品国产乱| 日韩欧美一级二级| 久久久久久久久97黄色工厂| 中文字幕不卡在线| 中文字幕在线视频一区| 亚洲人精品午夜| 一区二区三区欧美激情| 亚洲bt欧美bt精品| 奇米影视一区二区三区| 国产一区二区三区观看| 国产精品亚洲午夜一区二区三区 | 国产精品乱码人人做人人爱| 国产精品毛片高清在线完整版| 亚洲欧洲一区二区在线播放| 一区二区三区蜜桃网| 午夜欧美视频在线观看| 久久99精品国产91久久来源| 国产99一区视频免费| 99久久免费视频.com| 欧美性猛交xxxxxxxx| 精品国产一区二区三区不卡| 日本一区二区成人| 一区二区三区在线免费| 美女网站一区二区| www.66久久| 欧美一区二区大片| 国产精品丝袜黑色高跟| 亚洲国产综合色| 国产一区二区看久久| 一本色道久久综合狠狠躁的推荐| 欧美视频一二三区| 国产午夜精品一区二区| 亚洲成av人综合在线观看| 国产ts人妖一区二区| 欧美美女直播网站| 欧美激情一区三区| 日韩高清不卡一区| 99re热这里只有精品视频| 日韩亚洲欧美在线观看| 亚洲欧美日韩久久| 国产精品99久久久久久似苏梦涵|