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

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

?? powersleepdevice.cpp

?? usb wdm開發的電源管理 電源處于休眠狀態的例程。
?? CPP
字號:
// PowerSleepDevice.cpp
// Implementation of PowerSleepDevice device class
//
// Generated by DriverWizard version DriverStudio 2.6.0 (Build 336)
// Requires Compuware's DriverWorks classes
//

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

#include "PowerSleep.h"
#include "PowerSleepDevice.h"
#include "..\PowerSleepioctl.h"

#pragma hdrstop("PowerSleep.pch")

extern KTrace t;			// Global driver trace object	

GUID PowerSleepDevice_Guid = PowerSleepDevice_CLASS_GUID;

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

PowerSleepDevice::PowerSleepDevice(PDEVICE_OBJECT Pdo, ULONG Unit) :
	KPnpDevice(Pdo, &PowerSleepDevice_Guid)
{
	t << "PowerSleepDevice (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);

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

	// Adjust the standard Power Policy.The standard policy
	// requests the device to power ON only when a new IO
	// request is received.For this sample device driver,
	// the policy will be adjusted to power up the device
	// when the system is powered ON.
	m_PowerPolicies.m_GeneralPolicy.m_PowerUpOnS0 = TRUE;

}

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

NTSTATUS PowerSleepDevice::DefaultPnp(KIrp I) 
{
	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}

NTSTATUS PowerSleepDevice::DefaultPower(KIrp I) 
{
	t << "DefaultPower\n";

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

NTSTATUS PowerSleepDevice::SystemControl(KIrp I) 
{
	I.ForceReuseOfCurrentStackLocationInCalldown();
	return m_Lower.PnpCall(this, I);
}

NTSTATUS PowerSleepDevice::OnStartDevice(KIrp I)
{
	t << "OnStartDevice\n";

	return STATUS_SUCCESS;
}

NTSTATUS PowerSleepDevice::OnStopDevice(KIrp I)
{
	t << "OnStopDevice\n";

	return STATUS_SUCCESS;
}

NTSTATUS PowerSleepDevice::OnRemoveDevice(KIrp I)
{
	t << "OnRemoveDevice\n";

	return STATUS_SUCCESS;
}

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

	t << "Create\n";

	status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

	return status;
}

NTSTATUS PowerSleepDevice::Close(KIrp I)
{
	NTSTATUS status;

	t << "Close\n";

	status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT);

    return status;
}

NTSTATUS PowerSleepDevice::DeviceControl(KIrp I) 
{
	NTSTATUS status;

	switch (I.IoctlCode())
	{
		case POWERSLEEP_IOCTL_800:
			t << "POWERSLEEP_IOCTL_800_Handler\n";
			I.Information() = 0;
			status = STATUS_SUCCESS;
			break;

		default:
			// Unrecognized IOCTL request
			status = STATUS_INVALID_PARAMETER;
			break;
	}

	if (status == STATUS_PENDING)
	{
		return status;
	}
	else
	{
		return I.PnpComplete(this, status);
	}
}

///////////////////////////////////////////////////////////////////
// DetermineNewDevicePowerState
//
// This call is made by the framework to obtain the DEVICE_POWER_STATE
// that this device should transition to in response to POWER IRPs.  When
// a SYSTEM POWER IRP is received to change system power, this call is made 
// by the framework with the system's requested SYSTEM_POWER_STATE.  The 
// default base class implementation in KPnpDevice will use the DEVICE_CAPABILITIES
// structure reported from the bus driver for the hardware.  For most real
// devices, this structure will contain the correct DEVICE_POWER_STATE's.
// However, since this sample device driver does not control hardware, the
// system reports all DEVICE_POWER_STATE's to be PowerDeviceD1.  In order to
// demonstrate the framework's behavior for different power states, this
// virtual function has been overrided so that many power state transitions
// for the device can be supported.
//
// Most device drivers will not need to implement this function.
//
DEVICE_POWER_STATE PowerSleepDevice::DetermineNewDevicePowerState(SYSTEM_POWER_STATE SystemPowerState)
{
	DEVICE_POWER_STATE DevicePowerState;
    t << "DetermineNewDevicePowerState\n";

// The system is transitioning power to SystemPowerState.  We return
// the matching device power state for the system power state.  The
// base class KPnpDevice::Power member will handle requesting device 
// POWER IRP's (if required) to change device power based on these states.
	switch(SystemPowerState)
	{
	case PowerSystemWorking:
	// This is the fully ON power state.  If the device is not already in the
	// fully ON state, the base class will handle requesting a DEVICE
	// POWER IRP to put the device in the fully ON state.
		DevicePowerState = PowerDeviceD0;
		break;

	case PowerSystemSleeping1:
		DevicePowerState = PowerDeviceD1;
		break;

	case PowerSystemSleeping2:
		DevicePowerState = PowerDeviceD2;
		break;

	case PowerSystemSleeping3:
		DevicePowerState = PowerDeviceD2;
		break;

	case PowerSystemHibernate:
		DevicePowerState = PowerDeviceD3;
		break;

	case PowerSystemShutdown:
		DevicePowerState = PowerDeviceD3;
		break;

	default:
		break;
	}

	return DevicePowerState;
}

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

	t << "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.
//
	switch ( I.PowerStateType() ) 
	{
 	case SystemPowerState:
		t << "SystemPowerState " << SystemPowerStateName(I.PowerStateSetting().SystemState) << "\n" ;
		break;

 	case DevicePowerState:
		t << "DevicePowerState " << DevicePowerStateName(I.PowerStateSetting().DeviceState) << "\n" ;
		break;
	}
	return status;
}

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

	t << "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.
//
	switch ( I.PowerStateType() ) 
	{
 	case SystemPowerState:
		t << "SystemPowerState " << SystemPowerStateName(I.PowerStateSetting().SystemState) << "\n" ;
		break;

 	case DevicePowerState:
		t << "DevicePowerState " << DevicePowerStateName(I.PowerStateSetting().DeviceState) << "\n" ;
		break;
	}
	return status;
}

PCHAR DevicePowerStateName(DEVICE_POWER_STATE ps)
{
	static PCHAR PowerStates[] = {
		"PowerDeviceUnspecified",
		"PowerDeviceD0",
		"PowerDeviceD1",
		"PowerDeviceD2",
		"PowerDeviceD3"                  
	};

	if (ps > PowerDeviceD3) 
		return "<undefined power state>";
	else
		return PowerStates[ps];
}

PCHAR SystemPowerStateName(SYSTEM_POWER_STATE ps)
{
	static PCHAR PowerStates[] = {
		"PowerSystemUnspecified",
		"PowerSystemWorking",
		"PowerSystemSleeping1",
		"PowerSystemSleeping2",
		"PowerSystemSleeping3",
		"PowerSystemHibernate",
		"PowerSystemShutdown"
	};

	if (ps > PowerSystemShutdown) 
		return "<undefined power state>";
	else
		return PowerStates[ps];
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av福利| 91福利视频网站| 欧美亚洲一区二区三区四区| 日韩免费高清av| 日韩久久一区二区| 国产福利一区二区| 欧美一卡2卡3卡4卡| 最近中文字幕一区二区三区| 狠狠色狠狠色综合日日91app| 色哟哟国产精品| 国产精品久久久久久久久晋中| 日韩激情一区二区| 在线国产亚洲欧美| 亚洲视频香蕉人妖| 岛国精品一区二区| 国产欧美日韩综合精品一区二区| 免费在线视频一区| 欧美精品v日韩精品v韩国精品v| 最近日韩中文字幕| av一区二区久久| 久久久久久久久97黄色工厂| 麻豆国产精品官网| 日韩视频一区二区三区在线播放| 亚洲第一福利一区| 欧美日韩中文精品| 亚洲国产精品久久久久秋霞影院| 99精品视频在线播放观看| 中文字幕av一区二区三区| 激情偷乱视频一区二区三区| 日韩欧美一区电影| 美国欧美日韩国产在线播放| 欧美日韩第一区日日骚| 午夜精品久久久久影视| 678五月天丁香亚洲综合网| 日韩精品电影一区亚洲| 91精品蜜臀在线一区尤物| 免费成人小视频| 精品对白一区国产伦| 国产精品99久久不卡二区| 日本一区二区不卡视频| 色综合久久综合| 亚洲网友自拍偷拍| 日韩免费在线观看| 国产·精品毛片| 亚洲男人电影天堂| 日韩色在线观看| 国产精品亚洲视频| 亚洲乱码日产精品bd| 欧美系列在线观看| 免费观看成人av| 国产精品你懂的在线| 欧美日韩一区二区在线观看 | 欧美日韩国产综合视频在线观看| 一区二区三区免费看视频| 欧美男男青年gay1069videost | 久久精品国产77777蜜臀| 欧美精品一区二区三区四区| 成人黄色在线看| 亚洲中国最大av网站| 精品国产伦一区二区三区观看体验 | 亚洲一区国产视频| 日韩欧美国产综合在线一区二区三区| 另类综合日韩欧美亚洲| 国产精品欧美极品| 欧美精品丝袜中出| 成人av在线资源网站| 亚洲国产美女搞黄色| 久久久亚洲精品一区二区三区| 91美女片黄在线| 久久aⅴ国产欧美74aaa| 一区二区久久久久| 久久伊99综合婷婷久久伊| 在线观看视频一区| 国产盗摄精品一区二区三区在线| 一区二区三区在线看| 久久色在线观看| 欧美年轻男男videosbes| 成人免费看的视频| 国内不卡的二区三区中文字幕 | 亚洲天堂成人网| 日韩欧美国产高清| 欧美午夜精品久久久| 成人激情免费网站| 极品美女销魂一区二区三区 | 亚洲精品视频免费观看| 久久精品日韩一区二区三区| 制服丝袜国产精品| 91国偷自产一区二区开放时间| 国产精品18久久久久久久网站| 亚洲国产综合在线| 亚洲乱码国产乱码精品精98午夜| 精品久久久久一区二区国产| 欧美日韩在线播放三区四区| 99re66热这里只有精品3直播| 精品一区二区在线免费观看| 午夜日韩在线电影| 亚洲精品视频在线观看免费| 国产精品久久久久aaaa樱花| 26uuu亚洲婷婷狠狠天堂| 欧美一级视频精品观看| 777奇米成人网| 91麻豆精品国产91| 9191国产精品| 精品视频1区2区| 欧美少妇一区二区| 精品视频在线看| 欧美图区在线视频| 欧美日韩在线播放三区四区| 在线观看91视频| 欧美日韩国产成人在线免费| 欧美三级在线视频| 欧美精品一二三四| 欧美一区二区黄色| 精品成人a区在线观看| 欧美不卡123| 国产午夜精品福利| 国产精品九色蝌蚪自拍| 亚洲人成精品久久久久| 综合在线观看色| 亚洲不卡av一区二区三区| 亚洲高清免费观看| 日本午夜一区二区| 韩国精品主播一区二区在线观看| 精品综合久久久久久8888| 国产美女精品一区二区三区| 国产精品 欧美精品| 99久久婷婷国产综合精品| 色综合久久66| 制服丝袜亚洲播放| 久久蜜臀中文字幕| 亚洲色欲色欲www| 亚洲一区二区美女| 麻豆成人久久精品二区三区小说| 国模冰冰炮一区二区| 97se亚洲国产综合自在线观| 欧美人与禽zozo性伦| 欧美成人bangbros| 亚洲丝袜制服诱惑| 日韩精品欧美成人高清一区二区| 国产一区二区在线看| 99久免费精品视频在线观看| 91国偷自产一区二区开放时间| 日韩精品一区二区三区在线| 久久久久青草大香线综合精品| 国产精品三级av在线播放| 亚洲成年人影院| 懂色av中文字幕一区二区三区| 欧美午夜理伦三级在线观看| 久久久美女艺术照精彩视频福利播放| 亚洲欧洲三级电影| 日本va欧美va精品| 91在线观看污| 精品国产免费一区二区三区四区| 亚洲女厕所小便bbb| 国产一区二区久久| 欧美年轻男男videosbes| 欧美国产综合一区二区| 三级在线观看一区二区| 成人av免费在线| 精品va天堂亚洲国产| 婷婷久久综合九色综合伊人色| 成人看片黄a免费看在线| 欧美v亚洲v综合ⅴ国产v| 一区二区日韩av| 不卡的av在线| 久久久亚洲精品石原莉奈| 视频一区中文字幕国产| jlzzjlzz亚洲日本少妇| 久久久噜噜噜久噜久久综合| 日韩中文字幕av电影| 91国产免费观看| 国产精品国产a级| 国产乱子伦视频一区二区三区 | 欧美一区二区在线免费观看| 国产精品大尺度| 国产二区国产一区在线观看| 日韩精品一区二区三区视频在线观看| 亚洲免费观看高清完整版在线 | 国产经典欧美精品| 日韩三区在线观看| 亚洲电影在线播放| 91久久精品网| 亚洲黄色小视频| 一本高清dvd不卡在线观看| 欧美国产1区2区| 国产精品乡下勾搭老头1| 2017欧美狠狠色| 狠狠色狠狠色综合日日91app| 日韩片之四级片| 久久69国产一区二区蜜臀| 欧美一三区三区四区免费在线看| 亚洲夂夂婷婷色拍ww47 | 一区二区三区日韩欧美精品| 国产91精品露脸国语对白| 国产午夜亚洲精品午夜鲁丝片 | 经典三级在线一区| 欧美r级在线观看| 国产一区二区电影| 久久九九久久九九| 懂色av中文一区二区三区|