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

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

?? testdevice.cpp

?? 一個典型的USB驅動開發
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// TestDevice.cpp
// Implementation of TestDevice 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 "..\TestDeviceinterface.h"

#include "Test.h"
#include "TestDevice.h"
#include "..\testioctl.h"

#pragma hdrstop("Test.pch")

extern KDebugOnlyTrace t;	// Global driver trace object	

GUID TestDevice_Guid = TestDevice_CLASS_GUID;
////////////////////////////////////////////////////////////////////////
//  TestDevice::TestDevice
//
//	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.
//
TestDevice::TestDevice(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, &TestDevice_Guid)
{
	t << "Entering TestDevice::TestDevice (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, 4); 
	m_Endpoint1Out.Initialize(m_Lower, 0x1, 4); 
	m_Endpoint2In.Initialize(m_Lower, 0x82, 64); 
	m_Endpoint2Out.Initialize(m_Lower, 0x2, 64); 

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

	// Initialize the Power Policy settings to the "standard" policy
	SetPowerPolicy();

// TODO:	Customize the Power Policy for this device by setting
//			flags in m_PowerPolicies.
	m_pItem.Initialize(Pdo);

	m_kIrp=NULL;

}


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

TestDevice::~TestDevice()
{
	t << "Entering TestDevice::~TestDevice() (destructor)\n";
}


////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::DefaultPnp(KIrp I) 
{
	t << "Entering TestDevice::DefaultPnp\n" << I << EOL;

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

////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::DefaultPower(KIrp I) 
{
	t << "Entering TestDevice::DefaultPower\n" << I << EOL;

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

////////////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::SystemControl(KIrp I) 
{
	t << "Entering TestDevice::SystemControl\n";

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

////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::OnStartDevice(KIrp I)
{
	t << "Entering TestDevice::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.
	acStatus = m_Lower.ActivateConfiguration(
		1	// ConfigurationValue 1 (the first configuration)
		);

	switch (acStatus)
	{
		case AC_SUCCESS:
			status = STATUS_INSUFFICIENT_RESOURCES;
			m_kIrp = KIrp::Allocate( m_Lower.StackRequirement() );
			if ( m_kIrp == NULL )
			{
				m_Lower.ReleaseResources();
				break;
			}
			// allocate and initialize an URB
			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;
	}

   return status;  // base class completes the IRP
}


////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::OnStopDevice(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	t << "Entering TestDevice::OnStopDevice\n";

	m_Lower.DeActivateConfiguration();


// 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.
	UNREFERENCED_PARAMETER(I);
}

////////////////////////////////////////////////////////////////////////
//  TestDevice::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 TestDevice::OnRemoveDevice(KIrp I)
{
	t << "Entering TestDevice::OnRemoveDevice\n";
	if ( m_kIrp != NULL )	KIrp::Deallocate(m_kIrp);
	//	Device removed, release the system resources used by the USB lower device.
	m_Lower.ReleaseResources();


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

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

////////////////////////////////////////////////////////////////////////
//  TestDevice::OnDevicePowerUp
//
//	Routine Description:
//		Handler for IRP_MJ_POWER with minor function IRP_MN_SET_POWER
//		for a request to go to power on state from low power state
//
//	Parameters:
//		I - IRP containing POWER request

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
zzijzzij亚洲日本少妇熟睡| 亚洲精品日日夜夜| 精东粉嫩av免费一区二区三区| 日韩一区二区三区视频在线观看 | www.在线欧美| 亚洲日本电影在线| 欧美日韩午夜在线视频| 日韩经典中文字幕一区| 久久午夜电影网| 成人app网站| 亚洲成人免费av| 日韩一级欧美一级| 高清视频一区二区| 一区二区三区在线观看网站| 中文字幕中文字幕一区| 另类小说色综合网站| 精品日韩99亚洲| 国产露脸91国语对白| 国产精品午夜电影| 欧美曰成人黄网| 加勒比av一区二区| 伊人开心综合网| 3d成人动漫网站| 国产91丝袜在线播放| 一区二区三区中文在线| 日韩三级在线观看| 色噜噜狠狠一区二区三区果冻| 日日夜夜免费精品| 日韩毛片视频在线看| 制服丝袜中文字幕一区| av在线综合网| 蜜臀91精品一区二区三区| 亚洲地区一二三色| 中文字幕欧美激情| 日韩美女视频在线| 9l国产精品久久久久麻豆| 日韩专区中文字幕一区二区| 国产精品久久久久久久久图文区 | 在线日韩一区二区| 日本vs亚洲vs韩国一区三区二区| 久久免费偷拍视频| 欧美日韩一卡二卡| 99久久久无码国产精品| 久99久精品视频免费观看| 亚洲欧美电影一区二区| 欧美精品一区二区三区视频| 欧美亚洲综合另类| 91在线你懂得| 国产成人免费视| 免费精品99久久国产综合精品| 亚洲精品成人悠悠色影视| 国产女人18水真多18精品一级做| 欧美肥胖老妇做爰| 色94色欧美sute亚洲线路二| 国产成都精品91一区二区三| 蜜臀av一级做a爰片久久| 亚洲精品一卡二卡| 中文字幕欧美国产| 久久久国产午夜精品| 日韩精品一区二区三区中文不卡 | 国产精品女上位| 精品国产sm最大网站免费看| 欧美精品丝袜中出| 在线观看日韩电影| 欧洲av在线精品| 欧美图片一区二区三区| 91亚洲男人天堂| 91免费视频网| 色88888久久久久久影院按摩 | 国产美女av一区二区三区| 福利91精品一区二区三区| 国产一区在线观看视频| 精品一区二区三区久久| 精彩视频一区二区三区| 黑人精品欧美一区二区蜜桃| 久久99精品国产麻豆婷婷| 蜜桃视频免费观看一区| 麻豆91精品视频| 久久成人av少妇免费| 老色鬼精品视频在线观看播放| 美女视频网站黄色亚洲| 韩国三级中文字幕hd久久精品| 久久精品久久综合| 国产伦精一区二区三区| 成人禁用看黄a在线| 99精品久久免费看蜜臀剧情介绍| 成+人+亚洲+综合天堂| 色综合中文字幕| 在线看一区二区| 制服丝袜在线91| 久久久www成人免费无遮挡大片| 国产午夜久久久久| 亚洲视频在线观看三级| 一区二区久久久久| 美腿丝袜亚洲三区| 成人妖精视频yjsp地址| 色成年激情久久综合| 欧美精品一级二级三级| 久久青草国产手机看片福利盒子 | 奇米一区二区三区| 国产成人亚洲精品狼色在线 | 欧美一区二区三区视频免费 | 久久久高清一区二区三区| 中文字幕中文字幕一区二区| 亚洲午夜电影在线观看| 麻豆精品国产传媒mv男同| 风流少妇一区二区| 在线看不卡av| 精品久久久久久无| 国产精品久久久久久久午夜片| 亚洲国产精品久久久男人的天堂| 久久国产精品99精品国产 | 538prom精品视频线放| 久久久亚洲高清| 亚洲综合男人的天堂| 日本v片在线高清不卡在线观看| 国产剧情一区二区三区| 91麻豆高清视频| 精品国产髙清在线看国产毛片| 国产精品福利影院| 免费看黄色91| 色素色在线综合| 精品粉嫩aⅴ一区二区三区四区| 国产精品福利电影一区二区三区四区 | 一个色妞综合视频在线观看| 精品一区二区免费看| 色婷婷亚洲精品| 精品国产污网站| 亚洲妇熟xx妇色黄| 99re热这里只有精品视频| 欧美成人a在线| 亚洲一二三四区| 成人精品小蝌蚪| 日韩欧美电影一区| 亚洲一区二区精品3399| 成人午夜精品一区二区三区| 日韩一区二区电影在线| 亚洲综合男人的天堂| 成人毛片视频在线观看| 26uuu国产日韩综合| 亚洲国产毛片aaaaa无费看| 97se亚洲国产综合自在线观| 久久九九久久九九| 另类人妖一区二区av| 欧美色图第一页| 亚洲精品国久久99热| 成人一区二区三区中文字幕| 亚洲精品在线网站| 久久国产精品99精品国产 | 久久精品视频在线看| 日本在线不卡视频| 欧美精选午夜久久久乱码6080| 亚洲特黄一级片| 色综合夜色一区| 亚洲欧洲日韩av| 成人激情av网| 中文字幕免费观看一区| 精品中文字幕一区二区| 精品国产一区二区在线观看| 欧美bbbbb| 日韩精品专区在线影院重磅| 久久国产精品露脸对白| 91精品国产品国语在线不卡| 男人的j进女人的j一区| 欧美日韩国产一区二区三区地区| 一卡二卡三卡日韩欧美| 欧美伊人久久久久久久久影院| 一区二区三区在线视频观看58| 99re这里只有精品6| 制服丝袜亚洲精品中文字幕| 91久久精品一区二区三区| 最新欧美精品一区二区三区| 国产+成+人+亚洲欧洲自线| 欧美大片在线观看一区| 九色porny丨国产精品| 精品国产一区二区亚洲人成毛片 | 日本女优在线视频一区二区| 欧美一二三四在线| 国产自产高清不卡| 精品国产制服丝袜高跟| 国内成人精品2018免费看| 亚洲国产成人在线| 91麻豆国产福利精品| 午夜欧美电影在线观看| 777久久久精品| 狠狠网亚洲精品| 国产精品乱码一区二区三区软件| av爱爱亚洲一区| 亚洲国产综合91精品麻豆| 亚洲欧洲中文日韩久久av乱码| 99久久婷婷国产| 日本亚洲三级在线| 欧美国产精品一区二区| 欧洲精品中文字幕| 精品一区二区三区免费| 1024精品合集| 欧美一区二区视频观看视频 | 亚洲一区二区三区三| 精品日韩一区二区三区免费视频| 成人免费黄色在线|