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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? test1device.cpp

?? 一個(gè)典型的USB驅(qū)動(dòng)開發(fā)
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
// Test1Device.cpp
// Implementation of Test1Device device class
//
// Generated by DriverWizard version DriverStudio 3.1.0 (Build 1722)
// Requires Compuware's DriverWorks classes
//
//本程序修改自驅(qū)動(dòng)開發(fā)網(wǎng)上的一個(gè)實(shí)例,如有什么問題請(qǐng)到我的blog:unaided.21ic.org上討論
#pragma warning(disable:4065) // Allow switch statement with no cases
		  
#include <vdw.h>
#include <kusb.h>
#include "..\Test1Deviceinterface.h"

#include "Test1.h"
#include "Test1Device.h"
#include "..\test1ioctl.h"

#pragma hdrstop("Test1.pch")

extern KDebugOnlyTrace t;	// Global driver trace object	

GUID Test1Device_Guid = Test1Device_CLASS_GUID;
////////////////////////////////////////////////////////////////////////
//  Test1Device::Test1Device
//
//	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.
//
Test1Device::Test1Device(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, &Test1Device_Guid)
{
	t << "Entering Test1Device::Test1Device (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;
}


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

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


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

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

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

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

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

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

////////////////////////////////////////////////////////////////////////
//  Test1Device::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 Test1Device::OnStartDevice(KIrp I)
{
	t << "Entering Test1Device::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
}


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

	t << "Entering Test1Device::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);
}

////////////////////////////////////////////////////////////////////////
//  Test1Device::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 Test1Device::OnRemoveDevice(KIrp I)
{
	t << "Entering Test1Device::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);
}

////////////////////////////////////////////////////////////////////////
//  Test1Device::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
//
//	Return Value:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区在线免费观看| 91亚洲精品一区二区乱码| 欧美日韩精品欧美日韩精品一| 中文字幕五月欧美| av一区二区久久| 亚洲精品国产无天堂网2021 | 国产欧美视频一区二区| 国产综合色视频| 久久精子c满五个校花| 成人午夜免费av| 亚洲欧洲无码一区二区三区| 色婷婷一区二区| 亚洲午夜久久久久久久久电影院 | 欧美久久久久免费| 性欧美疯狂xxxxbbbb| 91精品婷婷国产综合久久竹菊| 蜜臀99久久精品久久久久久软件| 亚洲精品在线三区| 99久久久精品| 亚洲超碰精品一区二区| 欧美www视频| av午夜一区麻豆| 视频精品一区二区| 日本一区二区三区dvd视频在线| www.av亚洲| 无码av免费一区二区三区试看 | 欧美日韩高清影院| 经典三级在线一区| 亚洲欧美二区三区| 日韩一级片在线观看| 成人精品亚洲人成在线| 亚洲国产成人porn| 久久在线免费观看| 91久久精品一区二区| 美女免费视频一区| 亚洲欧美在线视频| 欧美电影免费观看完整版| 99r国产精品| 婷婷成人激情在线网| 欧美国产精品v| 91精品国产综合久久久久久久| 成人网页在线观看| 日韩高清一区在线| 亚洲婷婷在线视频| 2024国产精品视频| 欧美精品 国产精品| 暴力调教一区二区三区| 美女国产一区二区| 亚洲一区二区影院| 国产精品毛片久久久久久| 日韩欧美在线123| 在线亚洲欧美专区二区| 成人三级伦理片| 免费黄网站欧美| 亚洲国产精品影院| 日韩美女视频一区| 久久久国际精品| 日韩精品一区二区在线观看| 欧美日韩精品一区视频| 色综合久久88色综合天天6| 国产麻豆精品在线| 久久99精品久久久久久动态图| 亚洲一区二区三区精品在线| 国产精品夫妻自拍| 国产日韩精品一区| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 日本中文字幕一区二区视频| 亚洲激情男女视频| 中文字幕一区二区三区四区不卡 | av激情成人网| 国产伦精品一区二区三区视频青涩| 午夜精品一区在线观看| 亚洲一区二区欧美日韩| 一区二区三区日本| 亚洲天堂福利av| 中文字幕在线不卡一区二区三区| 国产色综合久久| 久久精品视频在线看| 久久久久国色av免费看影院| 欧美精品一区二区三区在线播放| 欧美一级生活片| 日韩欧美视频在线| 337p日本欧洲亚洲大胆色噜噜| 欧美不卡在线视频| 久久嫩草精品久久久久| 久久亚洲精品小早川怜子| 水野朝阳av一区二区三区| 午夜电影一区二区三区| 亚洲一区在线视频| 天堂蜜桃一区二区三区| 天天综合日日夜夜精品| 日韩电影在线一区二区三区| 麻豆精品视频在线| 国模无码大尺度一区二区三区| 国内精品视频一区二区三区八戒| 韩国女主播一区二区三区| 国产激情视频一区二区在线观看| 国产suv一区二区三区88区| 国产馆精品极品| av在线播放不卡| 欧美三级在线看| 日韩精品中文字幕一区二区三区| 欧美成人免费网站| 中文字幕精品一区| 一区二区视频在线看| 日韩主播视频在线| 极品少妇xxxx精品少妇偷拍| 波多野结衣在线aⅴ中文字幕不卡| 99这里只有精品| 欧美日韩国产美| 久久久五月婷婷| 亚洲视频一区二区在线| 日韩二区在线观看| 国产成人精品免费网站| 在线观看日韩av先锋影音电影院| 69成人精品免费视频| 国产女同互慰高潮91漫画| 亚洲综合视频在线| 久久se精品一区精品二区| 成人av免费网站| 884aa四虎影成人精品一区| 国产欧美精品一区| 亚洲a一区二区| 国产91丝袜在线播放九色| 在线视频中文字幕一区二区| 2023国产精品| 精品国产精品网麻豆系列| 中文字幕一区二区三区蜜月| 秋霞成人午夜伦在线观看| 成人h版在线观看| 日韩一区二区三区三四区视频在线观看 | 一区二区高清视频在线观看| 精品一区二区三区蜜桃| 在线日韩国产精品| 2021中文字幕一区亚洲| 亚洲福利视频一区| 成人18视频在线播放| 日韩欧美的一区二区| 亚洲精品视频自拍| 国产成人aaa| 精品国产第一区二区三区观看体验| 欧美亚洲另类激情小说| 久久久www成人免费毛片麻豆| 亚洲高清视频在线| 成人av影视在线观看| 欧美军同video69gay| 中文字幕一区二区三| 精品一区二区日韩| 欧美日韩国产欧美日美国产精品| 久久精品国产999大香线蕉| 91免费国产在线观看| 91偷拍与自偷拍精品| 亚洲日本成人在线观看| 在线观看日韩精品| 视频在线在亚洲| 日韩精品一区二区三区在线| 韩国精品在线观看| 中文字幕二三区不卡| 色综合久久久久综合| 日韩精品电影在线观看| 精品欧美一区二区三区精品久久 | ㊣最新国产の精品bt伙计久久| 91亚洲精品乱码久久久久久蜜桃| 亚洲精品午夜久久久| 91.com视频| 国产成人在线观看| 亚洲精品免费在线| 91麻豆精品91久久久久同性| 国产毛片一区二区| 亚洲欧洲综合另类在线| 在线播放日韩导航| 国产乱妇无码大片在线观看| 亚洲三级在线免费观看| 欧美福利视频一区| 国产麻豆午夜三级精品| 夜夜亚洲天天久久| 日韩欧美高清一区| av在线不卡免费看| 日本美女视频一区二区| 国产精品乱码一区二三区小蝌蚪| 欧美影片第一页| 国产精品自在在线| 亚洲一级二级三级| 国产午夜亚洲精品午夜鲁丝片| 色噜噜偷拍精品综合在线| 久草精品在线观看| 亚洲欧美国产高清| 精品sm在线观看| 色狠狠色噜噜噜综合网| 国产一区二区三区免费在线观看| 中文字幕亚洲视频| 日韩情涩欧美日韩视频| 91视频免费播放| 久久爱另类一区二区小说| 亚洲精品成人少妇| 久久精品这里都是精品| 欧美浪妇xxxx高跟鞋交| 91丨porny丨国产入口| 裸体健美xxxx欧美裸体表演| 一区二区三区成人|