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

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

?? usbwirelessdevice.cpp

?? 該程序實現(xiàn)了d12芯片和計算機的驅動連接
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// USBWirelessDevice.cpp
// Implementation of USBWirelessDevice device class
//
// Generated by DriverWizard version DriverStudio 3.1.0 (Build 1722)
// Requires Compuware's DriverWorks classes
//

#pragma warning(disable:4065) // Allow switch statement with no cases
		  
#include <vdw.h>
#include <kusb.h>
#include "..\USBWirelessDeviceinterface.h"

#include "USBWireless.h"
#include "USBWirelessDevice.h"
#include "..\USBWirelessioctl.h"

#pragma hdrstop("USBWireless.pch")

extern KTrace t;	// Global driver trace object	

GUID USBWirelessDevice_Guid = USBWirelessDevice_CLASS_GUID;
////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::USBWirelessDevice
//
//	Routine Description:
//		This is the constructor for the Functional Device Object, or FDO.
//		It is derived from KPnpDevice, which builds in automatic
//	    dispatching of subfunctions of IRP_MJ_POWER and IRP_MJ_PNP to
//		virtual member functions.
//
//	Parameters:
//		Pdo - Physical Device Object - this is a pointer to a system
//			device object that represents the physical device.
//
//		Unit - Unit number. This is a number to append to the device's
//			base device name to form the Logical Device Object's name
//
//	Return Value:
//		None   
//
//	Comments:
//		The object being constructed contains a data member (m_Lower) of type
//		KPnpLowerDevice. By initializing it, the driver binds the FDO to the
//		PDO and creates an interface to the upper edge of the system class driver.
//
USBWirelessDevice::USBWirelessDevice(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, &USBWirelessDevice_Guid)
{
	t << "現(xiàn)在進入WirelessDevice::USBWirelessDevice (constructor)\n";


	// Check constructor status
    if ( ! NT_SUCCESS(m_ConstructorStatus) )
	{
	    return;
	}

	// Remember our unit number
	m_Unit = Unit;

	// Initialize the lower device
	m_Lower.Initialize(this, Pdo);

	// Initialize the interface object.  The wizard generates code 
	// to support a single interface.  You may create and add additional 
	// interfaces.  By default, the wizard uses InterfaceNumber 0 (the 
	// first interface descriptor), ConfigurationValue 1 (the first
	// configuration descriptor), and initial interface alternate
	// setting of 0.  If your device has multiple interfaces or alternate
	// settings for an interface, you can add additional KUsbInterface
	// objects or adjust the parameters passed to this function.
	m_Interface.Initialize(
					m_Lower, //KUsbLowerDevice
					0,		 //InterfaceNumber
					1,		 //ConfigurationValue 
					0		 //Initial Interface Alternate Setting
					); 

	// Initialize each Pipe object
	m_Endpoint1IN.Initialize(m_Lower, 0x81, 16); 
	m_Endpoint1OUT.Initialize(m_Lower, 0x1, 16); 

    // Inform the base class of the lower edge device object
	SetLowerDevice(&m_Lower);

	// Initialize the PnP Policy settings to the "standard" policy
	SetPnpPolicy();

// TODO:	Customize the PnP Policy for this device by setting
//			flags in m_Policies.
//			flags in m_Policies.
	m_pItem.Initialize(Pdo);	//初試化工作項
}


////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::~USBWirelessDevice
//
//	Routine Description:
//		This is the destructor for the Functional Device Object, or FDO.
//
//	Parameters:
//		None
//
//	Return Value:
//		None
//
//	Comments:
//		None
//

USBWirelessDevice::~USBWirelessDevice()
{
	t << "進入 USBWirelessDevice::~USBWirelessDevice() (destructor)\n";
}


////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::DefaultPnp
//
//	Routine Description:
//		Default handler for IRP_MJ_PNP
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the lower device. It is 
//		the default handler for IRP_MJ_PNP. IRPs that correspond to
//		any virtual members of KpnpDevice that handle minor functions of
//		IRP_MJ_PNP and that are not overridden get passed to this routine.
//

NTSTATUS USBWirelessDevice::DefaultPnp(KIrp I) 
{
	t << "Entering USBWirelessDevice::DefaultPnp\n" << I << EOL;

	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}

////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::DefaultPower
//
//	Routine Description:
//		Default handler for IRP_MJ_POWER 
//  
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the lower device. It is 
//		the default handler for IRP_MJ_POWER.
//

NTSTATUS USBWirelessDevice::DefaultPower(KIrp I) 
{
	t << "Entering USBWirelessDevice::DefaultPower\n" << I << EOL;

	I.IndicatePowerIrpProcessed();
	I.CopyParametersDown();
	return m_Lower.PnpPowerCall(this, I);
}

////////////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::SystemControl
//
//	Routine Description:
//		Default handler for IRP_MJ_SYSTEM_CONTROL
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result returned from lower device
//
//	Comments:
//		This routine just passes the IRP through to the next device since this driver
//		is not a WMI provider.
//

NTSTATUS USBWirelessDevice::SystemControl(KIrp I) 
{
	t << "Entering USBWirelessDevice::SystemControl\n";

	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}

////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::OnStartDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_START_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		Typically, the driver sends a SET CONFIGURATION request for the
//		USB device by using KUsbLowerDevice::ActivateConfiguration with
//		the ConfigurationValue to activate.  The wizard generates code to 
//		support a single configuration.  You may create and add additional 
//		configurations. 
//

NTSTATUS USBWirelessDevice::OnStartDevice(KIrp I)
{
	t << "現(xiàn)在進入WirelessDevice::OnStartDevice\n";

	NTSTATUS status = STATUS_UNSUCCESSFUL;

	AC_STATUS acStatus = AC_SUCCESS;

	I.Information() = 0;

	// The default Pnp policy has already cleared the IRP with the lower device

	//By default, the wizard passes a ConfigurationValue of 1 to 
	//ActivateConfiguration().  This corresponds to the first configuration 
	//that the device reports in its configuration descriptor.  If the device 
	//supports multiple configurations, pass the appropriate
	//ConfigurationValue of the configuration to activate here.
	t << "現(xiàn)在將要配置usb\n";
	acStatus = m_Lower.ActivateConfiguration(
		1	// ConfigurationValue 1 (the first configuration)
		);
	t << "配置usb完畢\n";

	switch (acStatus)
	{
		case AC_SUCCESS:
			t << "USB Configuration OK\n";
			status = STATUS_SUCCESS;
			break;

		case AC_COULD_NOT_LOCATE_INTERFACE:
			t << "Could not locate interface\n";
			break;

		case AC_COULD_NOT_PRECONFIGURE_INTERFACE:
			t << "Could not get configuration descriptor\n";
			break;

		case AC_CONFIGURATION_REQUEST_FAILED:
			t << "Board did not accept configuration URB\n";
			break;

		case AC_FAILED_TO_INITIALIZE_INTERFACE_OBJECT:
			t << "Failed to initialize interface object\n";
			break;

		case AC_FAILED_TO_GET_DESCRIPTOR:
			t << "Failed to get device descriptor\n";
			break;

		case AC_FAILED_TO_OPEN_PIPE_OBJECT:
			//NOTE: this may not be an error.  It could mean that
			//the device has an endpoint for which a KUsbPipe object has
			//not been instanced.  If the intention is to not use this endpoint,
			//then it's likely not a problem.  
			status = STATUS_SUCCESS;
			t << "配置的返回值是Failed to open pipe object\n";
			break;

		default:
			t << "Unexpected error activating USB configuration\n";
			break;
	}
	//////////新添的內容///////////////////
	if ((acStatus == AC_SUCCESS) || (acStatus == AC_FAILED_TO_OPEN_PIPE_OBJECT))
	{
		status = STATUS_SUCCESS;

		GetStringDescriptors();	//調用獲取設備描述符例程

		m_kIrp = KIrp::Allocate( m_Lower.StackRequirement() );	//創(chuàng)建IRP
	
		if ( m_kIrp == NULL )
		{
			m_Lower.DeActivateConfiguration();
			m_Lower.ReleaseResources();
			status = STATUS_INSUFFICIENT_RESOURCES;
		}
		else
		{
			// allocate and initialize an URB
			m_pUrbIN = m_Endpoint1IN.BuildInterruptTransfer(
						m_bufferIN,			// transfer buffer
						16,					// transfer buffer size
						TRUE,				// Short Ok
						NULL,				// link urb
						NULL				// new urb
						);	//創(chuàng)建新的中斷傳輸URB

		/*	if ( m_pUrbIN == NULL )
			{
				KIrp::Deallocate(m_kIrp);
				m_Lower.DeActivateConfiguration();
				m_Lower.ReleaseResources();
				status = STATUS_INSUFFICIENT_RESOURCES;
			}*/


			m_pUrbOUT = m_Endpoint1OUT.BuildInterruptTransfer(
						m_bufferOUT,			// transfer buffer
						16,					// transfer buffer size
						TRUE,				// Short Ok
						NULL,				// link urb
						NULL				// new urb
						);	//創(chuàng)建新的中斷傳輸URB

			if (( m_pUrbOUT == NULL ) || ( m_pUrbIN == NULL ))
			{
				KIrp::Deallocate(m_kIrp);
				m_Lower.DeActivateConfiguration();
				m_Lower.ReleaseResources();
				status = STATUS_INSUFFICIENT_RESOURCES;
			}
		t << "在WirelessDevice::OnStartDevice函數中創(chuàng)建了兩個urb,正常執(zhí)行完畢\n";

		}
	}
	////////////////////////////////////////
   return status;  // base class completes the IRP
}


////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::OnStopDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_STOP_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		The system calls this when the device is stopped.
//		The driver should release any hardware resources
//		in this routine.
//
//		The base class passes the irp to the lower device.
//

NTSTATUS USBWirelessDevice::OnStopDevice(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	t << "現(xiàn)在進入WirelessDevice::OnStopDevice\n";

	m_Lower.DeActivateConfiguration();
	t << "停止配置后,現(xiàn)在跳出WirelessDevice::OnStopDevice\n";

// TODO:	Add device-specific code to stop your device   

	return status;
	
	// The following macro simply allows compilation at Warning Level 4
	// If you reference this parameter in the function simply remove the macro.
	//手工去掉RENCED_PARAMETER(I);
}

////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::OnRemoveDevice
//
//	Routine Description:
//		Handler for IRP_MJ_PNP subfcn IRP_MN_REMOVE_DEVICE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//		The system calls this when the device is removed.
//		Our PnP policy will take care of 
//			(1) giving the IRP to the lower device
//			(2) detaching the PDO
//			(3) deleting the device object
//

NTSTATUS USBWirelessDevice::OnRemoveDevice(KIrp I)
{
	t << "現(xiàn)在進入USBWirelessDevice::OnRemoveDevice\n";
      //刪除IRP和URB
	if ( m_kIrp != NULL )	KIrp::Deallocate(m_kIrp);
	if ( m_pUrbIN	!= NULL )	delete m_pUrbIN;
	if ( m_pUrbOUT	!= NULL )	delete m_pUrbOUT;
	// Device removed, release the system resources used by the USB lower device.
	m_Lower.ReleaseResources();


// TODO:	Add device-specific code to remove your device   
	t << "釋放完自己申請的資源,現(xiàn)在跳出USBWirelessDevice::OnRemoveDevice\n";
	return STATUS_SUCCESS;

	// The following macro simply allows compilation at Warning Level 4
	// If you reference this parameter in the function simply remove the macro.
	///手工去掉UNREFERENCED_PARAMETER(I);
}

////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::Create
//
//	Routine Description:
//		Handler for IRP_MJ_CREATE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//
//	Comments:
//

NTSTATUS USBWirelessDevice::Create(KIrp I)
{
	NTSTATUS status;

	t << "現(xiàn)在進入USBWirelessDevice::Create\n ";

// TODO: Add driver specific create handling code here

	// Generally a create IRP is targeted at our FDO, so we don't need
	// to pass it down to the PDO.  We have found for some devices, the
	// PDO is not expecting this Irp and returns an error code.
	// The default wizard code, therefore completes the Irp here using
	// PnpComplete().  The following commented code could be used instead
	// of PnpComplete() to pass the Irp to the PDO, which would complete it.
	//
//	I.ForceReuseOfCurrentStackLocationInCalldown();
//	status = m_Lower.PnpCall(this, I);

	status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

	t << "USBWirelessDevice::Create Status " << (ULONG)status << EOL;
		t << "現(xiàn)在跳出USBWirelessDevice::Create\n ";

	return status;
}

////////////////////////////////////////////////////////////////////////
//  USBWirelessDevice::Close
//
//	Routine Description:
//		Handler for IRP_MJ_CLOSE
//
//	Parameters:
//		I - Current IRP
//

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲女性喷水在线观看一区| 国产精品视频看| 日韩午夜激情视频| 欧美激情一区二区在线| 亚洲h在线观看| eeuss鲁片一区二区三区| 日韩一区二区麻豆国产| 一区二区在线观看视频| 国产一区二区看久久| 欧美美女直播网站| 日韩美女视频一区二区| 国产精品亚洲第一区在线暖暖韩国| 色av综合在线| 亚洲欧洲日产国码二区| 国产美女精品人人做人人爽 | 亚洲男人的天堂一区二区| 麻豆久久久久久久| 欧美日韩mp4| 亚洲天堂成人网| 成人黄色av网站在线| 国产亚洲综合av| 狠狠色伊人亚洲综合成人| 91麻豆精品国产91久久久久| 亚洲自拍偷拍图区| 色丁香久综合在线久综合在线观看| 中文字幕乱码亚洲精品一区| 国产美女精品一区二区三区| 日韩一区二区电影在线| 日产精品久久久久久久性色| 欧美日韩黄色影视| 偷拍亚洲欧洲综合| 欧美精品一二三| 天堂久久久久va久久久久| 在线看国产一区| 亚洲欧美另类久久久精品2019| 床上的激情91.| 国产精品国产三级国产普通话蜜臀 | 精品在线免费观看| 7777精品久久久大香线蕉| 亚洲国产精品自拍| 欧美乱熟臀69xxxxxx| 午夜久久久久久| 欧美疯狂做受xxxx富婆| 日本最新不卡在线| 欧美www视频| 大白屁股一区二区视频| 亚洲丝袜另类动漫二区| 欧美亚一区二区| 婷婷激情综合网| 精品国产一区二区三区忘忧草| 六月丁香婷婷色狠狠久久| 久久男人中文字幕资源站| 成人深夜福利app| 亚洲资源中文字幕| 国产偷国产偷亚洲高清人白洁| 高清beeg欧美| 亚洲精品成人在线| 欧美一级日韩一级| 成人综合在线观看| 亚洲九九爱视频| 在线不卡中文字幕播放| 国产一区二区伦理片| 亚洲免费av在线| 日韩精品一区二区三区在线观看 | 精品国产网站在线观看| 丰满放荡岳乱妇91ww| 亚洲一二三区视频在线观看| 日韩天堂在线观看| 成人毛片在线观看| 日韩成人av影视| 久久久久久久久久久黄色| 91在线丨porny丨国产| 日韩激情在线观看| 国产精品美女www爽爽爽| 欧美日韩一区久久| 成人午夜私人影院| 视频一区视频二区中文字幕| 日本一区二区三级电影在线观看| 欧美亚洲动漫制服丝袜| 国产一区在线观看麻豆| 亚洲成人www| 国产精品美日韩| 日韩美女视频在线| 色婷婷亚洲精品| 国产成人欧美日韩在线电影 | 亚洲欧美偷拍卡通变态| 337p日本欧洲亚洲大胆色噜噜| 日本高清不卡aⅴ免费网站| 国产制服丝袜一区| av电影天堂一区二区在线| 青娱乐精品视频| 一区二区三区免费看视频| 久久中文字幕电影| 91精品福利在线一区二区三区 | 国产一区二区在线电影| 亚洲一区二区视频在线| 国产精品国产三级国产普通话三级 | 天天色天天操综合| 亚洲乱码一区二区三区在线观看| 久久精品在这里| 日韩一区二区三区视频| 欧美日韩一区二区在线观看视频| 成人av先锋影音| 成人一级片网址| 国产99久久久国产精品免费看 | 亚洲精品一线二线三线| 欧美男同性恋视频网站| 欧美亚洲精品一区| 91豆麻精品91久久久久久| 99久久精品免费看国产免费软件| 国产精品自在在线| 国产精品中文字幕欧美| 国内外精品视频| 国模冰冰炮一区二区| 国产一区欧美二区| 国产乱码字幕精品高清av| 精品一区二区国语对白| 国产在线不卡一区| 六月丁香婷婷久久| 国产一区二区三区不卡在线观看| 久久国产三级精品| 国产精品一品二品| 成人av影视在线观看| 色偷偷一区二区三区| 在线观看日韩国产| 欧美日本在线看| 欧美一级理论片| 久久久精品日韩欧美| 久久精品一区八戒影视| 国产精品福利影院| 狠狠狠色丁香婷婷综合激情| 麻豆国产一区二区| 国产成人在线观看免费网站| 成人午夜av电影| 欧美性欧美巨大黑白大战| 欧美肥大bbwbbw高潮| 精品国内片67194| 欧美激情综合网| 亚洲激情男女视频| 青青草国产成人99久久| 国产乱国产乱300精品| 成人午夜在线免费| 欧美群妇大交群中文字幕| 日韩精品一区二区三区swag| 国产亚洲成av人在线观看导航 | 日韩免费观看2025年上映的电影 | 欧美精品粉嫩高潮一区二区| 欧美大白屁股肥臀xxxxxx| 国产精品免费人成网站| 亚洲高清中文字幕| 激情小说亚洲一区| 在线亚洲高清视频| 精品国产乱码91久久久久久网站| 国产精品国产自产拍高清av | 这里只有精品电影| 中文字幕电影一区| 日韩电影在线观看一区| 国产98色在线|日韩| 欧美日韩国产天堂| 国产日本欧美一区二区| 亚洲电影中文字幕在线观看| 国内外成人在线| 欧美色网站导航| 国产夜色精品一区二区av| 亚洲一区二区三区美女| 国产成人av一区| 欧美一级日韩免费不卡| 综合久久一区二区三区| 国产一区二区三区蝌蚪| 欧美日韩1234| 亚洲三级电影全部在线观看高清| 老鸭窝一区二区久久精品| 色婷婷综合在线| 欧美激情综合网| 国产主播一区二区三区| 欧美高清激情brazzers| 亚洲色图.com| 国产超碰在线一区| 日韩精品一区二区三区中文精品| 亚洲最色的网站| 成人久久久精品乱码一区二区三区| 欧美成人福利视频| 视频一区二区三区入口| 一本色道亚洲精品aⅴ| 国产日韩精品久久久| 日本成人中文字幕| 欧美日韩激情一区| 亚洲制服丝袜av| 91在线观看美女| 国产精品二区一区二区aⅴ污介绍| 麻豆一区二区在线| 欧美一级欧美一级在线播放| 亚洲妇熟xx妇色黄| 色八戒一区二区三区| 亚洲欧美日韩中文播放| 99精品欧美一区二区三区小说 | 国产一区免费电影| 日韩免费看的电影| 国内精品久久久久影院薰衣草| 日韩一卡二卡三卡国产欧美|