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

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

?? drvdevice.cpp

?? 5509a usb PC 驅動與測試程序,Driverworks開發,測試通過,使用見說明.請編譯.
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// DRVDevice.cpp
// Implementation of DRVDevice device class
//
// Generated by DriverWizard version DriverStudio 2.7.0 (Build 562)
// Requires Compuware's DriverWorks classes
//

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

#include "DRV.h"
#include "DRVDevice.h"
#include "..\DRVioctl.h"

#pragma hdrstop("DRV.pch")

extern KTrace t;			// Global driver trace object	

GUID DRVDevice_Guid = DRVDevice_CLASS_GUID;

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

DRVDevice::DRVDevice(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, &DRVDevice_Guid)
{
	t << "Entering DRVDevice::DRVDevice (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_Endpoint2IN.Initialize(m_Lower, 0x82, 64); 
	m_Endpoint2OUT.Initialize(m_Lower, 0x2, 64); 
	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.

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

// TODO:	Customize the Power Policy for this device by setting
//			flags in m_PowerPolicies.

}


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

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

////////////////////////////////////////////////////////////////////////
//  PNPMinorFunctionName
//
//	Routine Description:
//		Return a string describing the Plug and Play minor function	
//
//	Parameters:
//		mn - Minor function code
//
//	Return Value:
//		char * - Ascii name of minor function
//
//	Comments:
//		This function is used for tracing the IRPs.  Remove the function,
//		or conditionalize it for debug-only builds, if you want to save
//		space in the driver image.
//
	
char *PNPMinorFunctionName(ULONG mn)
{
	static char* minors[] = {
		"IRP_MN_START_DEVICE",
		"IRP_MN_QUERY_REMOVE_DEVICE",
		"IRP_MN_REMOVE_DEVICE",
		"IRP_MN_CANCEL_REMOVE_DEVICE",
		"IRP_MN_STOP_DEVICE",
		"IRP_MN_QUERY_STOP_DEVICE",
		"IRP_MN_CANCEL_STOP_DEVICE",
		"IRP_MN_QUERY_DEVICE_RELATIONS",
		"IRP_MN_QUERY_INTERFACE",
		"IRP_MN_QUERY_CAPABILITIES",
		"IRP_MN_QUERY_RESOURCES",
		"IRP_MN_QUERY_RESOURCE_REQUIREMENTS",
		"IRP_MN_QUERY_DEVICE_TEXT",
		"IRP_MN_FILTER_RESOURCE_REQUIREMENTS",
		"<unknown minor function>",
		"IRP_MN_READ_CONFIG",
		"IRP_MN_WRITE_CONFIG",
		"IRP_MN_EJECT",
		"IRP_MN_SET_LOCK",
		"IRP_MN_QUERY_ID",
		"IRP_MN_QUERY_PNP_DEVICE_STATE",
		"IRP_MN_QUERY_BUS_INFORMATION",
		"IRP_MN_DEVICE_USAGE_NOTIFICATION",
		"IRP_MN_SURPRISE_REMOVAL",
		"IRP_MN_QUERY_LEGACY_BUS_INFORMATION"
	};

	if (mn > 0x18) // IRP_MN_QUERY_LEGACY_BUS_INFORMATION
		return "<unknown minor function>";
	else
		return minors[mn];
}

////////////////////////////////////////////////////////////////////////
//  DRVDevice::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 DRVDevice::DefaultPnp(KIrp I) 
{
	t << "Entering DRVDevice::DefaultPnp with IRP minor function="
	  << PNPMinorFunctionName(I.MinorFunction()) << EOL;

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


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

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

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

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

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

   return status;  // base class completes the IRP
}


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

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

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

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

////////////////////////////////////////////////////////////////////////
//  DRVDevice::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:
//		NTSTATUS - Status code indicating success or failure
//
//	Comments:
//		This routine implements the OnDevicePowerUp function.
//		This function was called by the framework from the completion
//		routine of the IRP_MJ_POWER dispatch handler in KPnpDevice.
//		The bus driver has completed the IRP and this driver can now
//		access the hardware device.  
//		This routine runs at dispatch level.
//	

NTSTATUS DRVDevice::OnDevicePowerUp(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

	t << "Entering DRVDevice::OnDevicePowerUp\n";

// TODO:	Service the device.
//			Restore any context to the hardware device that
//			was saved during the handling of a power down request.
//			See the OnDeviceSleep function.
//			Do NOT complete this IRP.
//
	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);
}

////////////////////////////////////////////////////////////////////////
//  DRVDevice::OnDeviceSleep
//
//	Routine Description:
//		Handler for IRP_MJ_POWER with minor function IRP_MN_SET_POWER
//		for a request to go to a low power state from a high power state
//
//	Parameters:
//		I - IRP containing POWER request
//
//	Return Value:
//		NTSTATUS - Status code indicating success or failure
//
//	Comments:
//		This routine implements the OnDeviceSleep function.
//		This function was called by the framework from the IRP_MJ_POWER 
//		dispatch handler in KPnpDevice prior to forwarding to the PDO.
//		The hardware has yet to be powered down and this driver can now
//		access the hardware device.  
//		This routine runs at passive level.
//	

NTSTATUS DRVDevice::OnDeviceSleep(KIrp I)
{
	NTSTATUS status = STATUS_SUCCESS;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品午夜春色av| 久久精品国产秦先生| 天堂资源在线中文精品| 国产在线不卡一卡二卡三卡四卡| av成人免费在线| 亚洲一区在线观看免费观看电影高清| 麻豆成人在线观看| 色综合久久久网| 欧美激情一区二区在线| 日本女优在线视频一区二区| 色婷婷av一区二区三区之一色屋| 欧美精品一区二区三区久久久| 一区二区三区在线免费视频| 成人免费看片app下载| 2019国产精品| 婷婷成人激情在线网| 色婷婷综合久色| 国产精品毛片无遮挡高清| 韩国理伦片一区二区三区在线播放| 色系网站成人免费| 中文字幕一区二区5566日韩| 国产麻豆一精品一av一免费| 欧美精品日韩一区| 午夜欧美2019年伦理| 欧美制服丝袜第一页| 亚洲欧洲成人精品av97| 国产精品白丝av| 国产亚洲婷婷免费| 国产一区二区三区四区五区入口| 日韩视频免费直播| 蜜臀久久久99精品久久久久久| 欧美人妇做爰xxxⅹ性高电影| 亚洲一区二区美女| 欧美天天综合网| 亚洲成a人片综合在线| 欧美日韩性生活| 亚洲a一区二区| 欧美一区二区视频在线观看2022| 天堂久久久久va久久久久| 337p亚洲精品色噜噜| 美国十次了思思久久精品导航| 欧美一级二级三级蜜桃| 久久国产欧美日韩精品| 欧美精品一区二区蜜臀亚洲| 国产成人精品一区二区三区网站观看| 亚洲精品在线三区| 成人激情文学综合网| 亚洲男人天堂av网| 91精选在线观看| 国内不卡的二区三区中文字幕| 国产亚洲精品bt天堂精选| 成人免费视频caoporn| 韩国v欧美v日本v亚洲v| 亚洲国产经典视频| 日本精品裸体写真集在线观看| 亚洲综合成人网| 91麻豆精品国产91久久久久久| 久久99国产精品免费网站| 久久精品在线观看| 91亚洲国产成人精品一区二三| 亚洲国产精品人人做人人爽| 日韩欧美中文字幕制服| 国产精品18久久久久久久久| 亚洲精品精品亚洲| 日韩精品一区二区三区视频在线观看| 国产激情视频一区二区在线观看| 国产精品久久久久久亚洲毛片 | 精品久久久久久久人人人人传媒| 久久99最新地址| 中文字幕在线观看不卡视频| 欧美日韩情趣电影| 国产精品一区专区| 亚洲综合色在线| 久久精品综合网| 欧美午夜电影一区| 国产jizzjizz一区二区| 亚洲影视在线观看| 国产欧美一区二区精品婷婷| 欧美丝袜第三区| 国产·精品毛片| 青青草97国产精品免费观看 | 国产综合色在线视频区| 一区二区三区加勒比av| 久久久精品人体av艺术| 欧美日韩黄色影视| 2024国产精品视频| 欧美日韩一区二区三区高清 | 日欧美一区二区| 国产精品无圣光一区二区| 欧美一区二区三区爱爱| 在线观看亚洲专区| 成人午夜看片网址| 精品中文字幕一区二区小辣椒| 亚洲激情成人在线| 国产精品久久久一区麻豆最新章节| 欧美一级二级在线观看| 欧美色图在线观看| 色哟哟亚洲精品| 99v久久综合狠狠综合久久| 国产最新精品精品你懂的| 肉色丝袜一区二区| 午夜精品久久久久久久久久久| 亚洲免费观看高清完整版在线观看熊 | 久草这里只有精品视频| 婷婷综合另类小说色区| 一区二区欧美视频| 亚洲精品久久久蜜桃| 国产精品伦一区| 国产精品毛片久久久久久| 久久综合狠狠综合久久激情| 欧美成人女星排行榜| 91精品在线麻豆| 91精品国产综合久久久蜜臀粉嫩| 欧美三级欧美一级| 51精品视频一区二区三区| 欧美久久久影院| 欧美日韩专区在线| 中文字幕 久热精品 视频在线 | 东方aⅴ免费观看久久av| 国产一区二区三区四区五区美女| 久久99国产精品久久99| 国产精品中文字幕欧美| 丁香亚洲综合激情啪啪综合| 国产·精品毛片| 91看片淫黄大片一级在线观看| 99国产精品国产精品久久| 在线一区二区三区四区| 欧美吞精做爰啪啪高潮| 欧美一区永久视频免费观看| 日韩欧美国产三级| 国产喂奶挤奶一区二区三区| 国产精品无遮挡| 亚洲一区精品在线| 秋霞影院一区二区| 国产高清在线精品| 97aⅴ精品视频一二三区| 色8久久精品久久久久久蜜| 欧美日韩在线一区二区| 欧美变态凌虐bdsm| 中文字幕中文字幕一区| 一区二区三区国产| 日韩高清在线电影| 国产a精品视频| 欧美亚洲国产一区二区三区va | 91视频精品在这里| 欧美一级高清片| 国产精品久久久久四虎| 亚洲自拍欧美精品| 精品在线你懂的| 91在线观看免费视频| 7878成人国产在线观看| 日本一区二区三级电影在线观看 | 国产精品日韩精品欧美在线| 一区二区在线观看视频在线观看| 日本va欧美va精品发布| 精品久久久久久久久久久久包黑料 | 亚洲成人综合视频| 国产在线精品一区二区不卡了 | 久久精品人人做人人爽97| 亚洲丝袜美腿综合| 麻豆国产精品777777在线| 99久久精品免费看国产免费软件| 欧美另类变人与禽xxxxx| 国产精品麻豆欧美日韩ww| 午夜a成v人精品| av不卡在线观看| 精品三级在线看| 亚洲va在线va天堂| 成人av片在线观看| 日韩一区二区三免费高清| 亚洲视频你懂的| 国产高清在线观看免费不卡| 欧美日韩一区小说| 国产精品成人在线观看| 韩国中文字幕2020精品| 欧美日韩一区国产| 亚洲欧美日韩人成在线播放| 激情欧美日韩一区二区| 91精品国产欧美一区二区| 国产精品久久久久一区| 国产99久久久久久免费看农村| 欧美精品亚洲一区二区在线播放| 亚洲婷婷综合色高清在线| 粉嫩久久99精品久久久久久夜| 欧美大胆一级视频| 午夜在线电影亚洲一区| 91黄色免费版| 亚洲女同一区二区| 99热这里都是精品| 国产精品污网站| 国产精品538一区二区在线| 日韩欧美视频一区| 蜜桃视频在线观看一区| 4438x成人网最大色成网站| 亚洲福中文字幕伊人影院| 欧美亚洲一区二区在线观看| 亚洲精品国产第一综合99久久 | 欧美精品乱人伦久久久久久| 亚洲一区免费在线观看| 日本高清不卡在线观看|