亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美浪妇xxxx高跟鞋交| 国产亚洲欧洲一区高清在线观看| 日本不卡一二三区黄网| 国产精品国产成人国产三级| 欧美日韩国产影片| 欧美三级欧美一级| 欧美精品成人一区二区三区四区| av中文字幕在线不卡| 国产成人精品www牛牛影视| 狠狠色2019综合网| 国产美女在线观看一区| 国产精品一区二区你懂的| 精品在线免费视频| 国产成人在线色| 99精品在线观看视频| 99riav一区二区三区| k8久久久一区二区三区| 99久久精品一区二区| 色先锋aa成人| 3d成人h动漫网站入口| 91精品福利在线一区二区三区| 欧美日韩精品电影| 精品国产sm最大网站| 久久这里只有精品视频网| 26uuu另类欧美亚洲曰本| 久久久久国产精品免费免费搜索| 国产性天天综合网| 亚洲色图欧美在线| 天天爽夜夜爽夜夜爽精品视频| 天堂影院一区二区| 国产成人在线网站| 91国产成人在线| 欧美大片免费久久精品三p| 欧美videos中文字幕| 国产网站一区二区| 亚洲高清免费观看| 国产精品一线二线三线精华| 激情国产一区二区| 一本久道中文字幕精品亚洲嫩| 欧洲生活片亚洲生活在线观看| 欧美人与z0zoxxxx视频| 精品国产乱码久久久久久影片| 国产日韩欧美在线一区| 最新国产精品久久精品| 午夜不卡av免费| 粉嫩久久99精品久久久久久夜| 色狠狠综合天天综合综合| 91精品久久久久久久91蜜桃| 欧美一级电影网站| 亚洲靠逼com| 国产成人精品午夜视频免费| 成人黄动漫网站免费app| 欧美日韩mp4| 自拍偷拍国产精品| 国产精品一区二区三区99| 欧美性感一区二区三区| 久久精品视频网| 五月激情六月综合| 在线观看中文字幕不卡| 久久久久9999亚洲精品| 性做久久久久久久免费看| 高清不卡一区二区在线| 日韩一区二区影院| 亚洲一区二区视频| 色婷婷国产精品久久包臀| 精品少妇一区二区三区日产乱码 | 亚洲主播在线观看| 成人黄色片在线观看| 日韩欧美中文字幕一区| 亚洲午夜久久久久久久久电影院 | 99re成人精品视频| 久久久久亚洲蜜桃| 激情综合色综合久久综合| 欧美日韩一卡二卡| 亚洲国产精品视频| 欧美色涩在线第一页| 中文字幕亚洲欧美在线不卡| 日本亚洲免费观看| 日韩午夜在线影院| 久久福利视频一区二区| 51午夜精品国产| 奇米影视一区二区三区| 日本韩国欧美在线| 亚洲一区二区精品3399| 色综合激情五月| 一区二区三区免费| 欧美日韩你懂得| 日本欧美一区二区在线观看| 99精品视频一区二区三区| 国产精品美女一区二区三区| 美女国产一区二区三区| 欧美成人a在线| 国产乱子轮精品视频| 久久综合色8888| 成人av资源网站| 一区二区三区中文在线| 欧美图片一区二区三区| 五月激情丁香一区二区三区| 一本一本大道香蕉久在线精品| 中文字幕在线播放不卡一区| 国产精品一区二区久久精品爱涩| 久久伊99综合婷婷久久伊| 国产一区 二区| 亚洲特黄一级片| 91精品在线一区二区| 狠狠色丁香婷婷综合| 国产精品亲子伦对白| 色婷婷av久久久久久久| 五月天丁香久久| 国产精品污污网站在线观看| 国产激情视频一区二区三区欧美| 欧美韩国日本综合| 欧美精品日韩一区| 国产99久久精品| 午夜av电影一区| 欧美国产精品专区| 91精品在线麻豆| av一本久道久久综合久久鬼色| 一区二区不卡在线播放 | 国产成人亚洲综合a∨婷婷图片| 中文字幕成人av| 91麻豆精品国产自产在线观看一区| 免费久久99精品国产| 中文字幕乱码亚洲精品一区| 国产成人一级电影| 奇米精品一区二区三区四区 | 欧美va亚洲va| 欧美性大战久久久久久久蜜臀| 麻豆精品一二三| 亚洲综合小说图片| 欧美—级在线免费片| 91精品国产综合久久久久久漫画| 国产成人亚洲精品青草天美| 国产精品成人在线观看| 日韩一区二区三区四区| 欧日韩精品视频| www.日韩av| 国产91综合网| 狠狠狠色丁香婷婷综合激情| 综合自拍亚洲综合图不卡区| 欧美日韩国产高清一区| av不卡一区二区三区| 国内精品免费**视频| 亚洲bt欧美bt精品| 亚洲色图欧美在线| 国产精品成人网| 中文字幕乱码一区二区免费| 欧美日韩中文字幕一区| 不卡一区中文字幕| aaa国产一区| 成人福利视频网站| 成人激情免费视频| 成人一级片网址| 岛国一区二区在线观看| 国产呦精品一区二区三区网站| 日本亚洲视频在线| 另类中文字幕网| 激情综合网最新| 国产精品一二三四五| 久久国产剧场电影| 国产精品白丝jk白祙喷水网站| 日本欧美一区二区在线观看| 亚洲美女视频一区| 亚洲成av人片在线观看| 亚洲福利视频导航| 日本美女视频一区二区| 偷拍自拍另类欧美| 免费一级欧美片在线观看| 日韩二区在线观看| 极品少妇xxxx精品少妇| 国产在线精品免费| 99精品黄色片免费大全| a级精品国产片在线观看| 色呦呦一区二区三区| 色网综合在线观看| 日韩午夜电影av| 久久久久久黄色| 亚洲在线视频一区| 精品一区二区三区久久久| 韩国三级电影一区二区| 国产老肥熟一区二区三区| 丁香五精品蜜臀久久久久99网站| 成人激情小说网站| 5858s免费视频成人| 精品国产一二三区| 亚洲三级久久久| 日韩av午夜在线观看| 国产精一品亚洲二区在线视频| 国产成人av一区二区三区在线| 成人高清免费观看| 91精选在线观看| 1区2区3区欧美| 精彩视频一区二区三区| 99久久精品一区二区| 欧美放荡的少妇| 欧美韩国日本不卡| 奇米一区二区三区av| www.欧美日韩| 精品日韩99亚洲| 亚洲成人资源在线|