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

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

?? d12_driverdevice.cpp

?? USB d12 驅動
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// D12_DriverDevice.cpp
// Implementation of D12_DriverDevice device class
//
// Generated by DriverWizard version DriverStudio 3.0.0 (Build 1126)
// Requires Compuware's DriverWorks classes
//

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

#include "D12_Driver.h"
#include "D12_DriverDevice.h"
#include "..\D12_Driverioctl.h"

#pragma hdrstop("D12_Driver.pch")

extern KTrace t;			// Global driver trace object	

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


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

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



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

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

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

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

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

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



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


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

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

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

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

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

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

	t << "Entering D12_DriverDevice::OnDeviceSleep\n";

// TODO:	Service the device.
//			Save any context to the hardware device that will be required 
//			during a power up request. See the OnDevicePowerUp function.
//			Do NOT complete this IRP.  The base class handles forwarding
//			this IRP to the PDO.
//
	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);
}

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

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

	t << "Entering D12_DriverDevice::Create, " << I << EOL;

// 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 << "D12_DriverDevice::Create Status " << (ULONG)status << EOL;

	return status;
}

////////////////////////////////////////////////////////////////////////
//  D12_DriverDevice::Close
//
//	Routine Description:
//		Handler for IRP_MJ_CLOSE
//
//	Parameters:
//		I - Current IRP
//
//	Return Value:
//		NTSTATUS - Result code
//

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人a∨高清免费观看| 欧美一区二区三区免费大片| 成人动漫一区二区| 麻豆91在线观看| 日韩av一级电影| 日本网站在线观看一区二区三区 | 午夜伦理一区二区| 亚洲国产日日夜夜| 亚洲国产视频一区二区| 午夜精品免费在线观看| 日本午夜精品一区二区三区电影| 欧美a一区二区| 麻豆高清免费国产一区| 国产麻豆精品在线观看| 成人一区二区三区中文字幕| 99久久久国产精品| 在线观看一区二区视频| 91精品国产综合久久福利| 91精品国产欧美一区二区18| 欧美哺乳videos| 国产偷国产偷精品高清尤物| 亚洲欧洲av另类| 亚洲一区二区精品3399| 日日夜夜免费精品视频| 久久黄色级2电影| 成人一区二区三区视频| 色8久久人人97超碰香蕉987| 欧美日韩www| 精品久久久久久无| 日本一区二区久久| 一区二区三区中文免费| 日韩 欧美一区二区三区| 国产乱码精品1区2区3区| 99国产精品久久久久| 欧美精品久久一区| 国产欧美精品一区| 伊人婷婷欧美激情| 免费成人小视频| av电影一区二区| 欧美日韩久久一区二区| 精品国产污网站| 亚洲欧美怡红院| 免费精品视频在线| www.亚洲国产| 欧美一区二区网站| 中文字幕一区二区三区色视频| 丝袜美腿亚洲一区二区图片| 国产一区二区成人久久免费影院| 色婷婷激情一区二区三区| 91女厕偷拍女厕偷拍高清| 色综合天天视频在线观看| 在线精品观看国产| 欧美videofree性高清杂交| 国产精品视频yy9299一区| 国产精品视频九色porn| 亚洲人成影院在线观看| 日韩福利电影在线| 国产91清纯白嫩初高中在线观看| 不卡的av电影| 91精品国产乱| 亚洲精品日韩综合观看成人91| 日韩在线播放一区二区| 欧美视频在线一区| 久久久久亚洲综合| 视频在线观看国产精品| 欧美三级欧美一级| 中文字幕佐山爱一区二区免费| 奇米色一区二区三区四区| 国产传媒日韩欧美成人| 99久久久久久| 欧美日韩国产精选| 国产精品久久久久7777按摩| 国产在线观看免费一区| 亚洲国产美女搞黄色| 国产亚洲精品超碰| 8v天堂国产在线一区二区| 中文字幕在线不卡一区二区三区| 蜜桃一区二区三区在线| 99久久精品免费| 久久尤物电影视频在线观看| 性久久久久久久久| 91视频国产观看| 国产精品久久久久久久裸模| 激情五月播播久久久精品| 欧美精品三级日韩久久| 亚洲午夜久久久久中文字幕久| 成人a级免费电影| 国产人妖乱国产精品人妖| 精品一区二区av| 日韩亚洲欧美在线| 首页亚洲欧美制服丝腿| 欧美亚洲一区二区在线观看| 亚洲另类在线视频| 97久久精品人人做人人爽| 国产欧美日韩视频在线观看| 精品系列免费在线观看| 精品久久免费看| 国产在线一区二区综合免费视频| 日韩亚洲欧美综合| 麻豆91免费看| 日韩精品一区二区三区四区 | 青青草国产精品97视觉盛宴| 欧美在线视频日韩| 亚洲一区二区三区四区的| 色综合天天综合在线视频| 亚洲视频在线一区观看| 不卡av免费在线观看| 国产精品素人一区二区| 成人美女视频在线观看| 日本一二三不卡| 高清国产午夜精品久久久久久| 久久精品一二三| 国产suv精品一区二区6| 国产精品久久久久影视| 91麻豆文化传媒在线观看| 国产精品高潮久久久久无| 99精品一区二区| 一区二区三区成人| 7777精品伊人久久久大香线蕉经典版下载| 日韩精品一级二级| 精品久久久久99| 国产精品亚洲第一区在线暖暖韩国| 国产欧美一区二区在线| 91麻豆产精品久久久久久| 亚洲国产一区二区在线播放| 欧美一区二区视频在线观看2022| 久久激情五月婷婷| 欧美国产日韩精品免费观看| 色先锋aa成人| 五月天激情综合网| 久久影院视频免费| 99久久国产综合精品女不卡| 亚洲高清视频的网址| 欧美一级艳片视频免费观看| 国产成人精品www牛牛影视| 中文字幕一区二区三区四区 | 亚洲精品国产a| 欧美日韩国产免费一区二区| 精品亚洲成av人在线观看| 中文字幕一区二区视频| 欧美日韩国产中文| 国内精品嫩模私拍在线| 中文字幕在线观看一区二区| 欧美日韩免费高清一区色橹橹| 国产在线麻豆精品观看| 亚洲桃色在线一区| 欧美一级国产精品| 成人av一区二区三区| 视频一区二区国产| 亚洲国产成人自拍| 欧美丰满一区二区免费视频 | 一本色道**综合亚洲精品蜜桃冫| 日韩精品福利网| 国产精品视频一区二区三区不卡| 欧美视频一区在线观看| 国产一区二区不卡在线| 一区二区三区四区五区视频在线观看| 欧美一区二区三区免费视频| 99在线视频精品| 麻豆久久一区二区| 亚洲激情av在线| 久久久精品影视| 欧美电影一区二区三区| jiyouzz国产精品久久| 久久er99热精品一区二区| 亚洲精品久久嫩草网站秘色| 精品国内片67194| 欧美最猛性xxxxx直播| 成人午夜大片免费观看| 蜜桃av一区二区三区电影| 亚洲靠逼com| 久久九九久久九九| 欧美日本一道本| 色哟哟国产精品| 成人做爰69片免费看网站| 天天av天天翘天天综合网| 综合久久综合久久| 国产日产欧美一区| 日韩你懂的在线播放| 欧美在线观看视频一区二区 | 92精品国产成人观看免费| 激情欧美一区二区| 日韩一区精品视频| 亚洲国产一二三| 亚洲精品免费在线播放| 国产精品伦理在线| 久久久久高清精品| 亚洲精品一线二线三线| 日韩一二三区视频| 91精品国产综合久久精品| 欧美曰成人黄网| 91美女在线观看| 99视频一区二区三区| 国产精品系列在线播放| 亚洲一区二区成人在线观看| 亚洲精品国产精品乱码不99 | 奇米亚洲午夜久久精品| 天堂一区二区在线免费观看| 亚洲一区成人在线| 一区二区在线电影|