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

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

?? driver.cpp

?? Windows Driver Framework編成例子
?? CPP
字號:
// Driver.cpp -- Driver object management for STUPID.SYS (DFW version)
// Copyright (C) 2003 by Walter Oney
// All rights reserved

// STUPID.SYS is the simplest possible framework-based driver. It creates
// a DFWDRIVER object and relies on the framework to handle all aspects of
// interfacing with the PnP and Power Managers -- including creating a
// DFWDEVICE object in the AddDevice function. You should be able to install,
// disable, enable, and uninstall one or more STUPID devices and to put the
// computer through power cycles with them installed.

#include "stddcls.h"
#include "driver.h"
#include "version.h"

DFWSTATUS EvtDriverDeviceAdd(DFWDRIVER hDriver, DFWDEVICE hDevice);
VOID EvtDriverUnload(DFWDRIVER hDriver);

////////////////////////////////////////////////////////////////////////////////
// DriverEntry creates and initializes a framework driver object. This function
// is called at PASSIVE_LEVEL without any presentation lock and can therefore be
// kept in paged memory.

#pragma PAGEDCODE

extern "C" NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
	{							// DriverEntry
	PAGED_CODE();

	// This driver uses DfwTraceDbgPrint to print a few debugging messages,
	// but best practice would be to use WPP tracing instead. Next best 
	// would be to call DfwTraceMessage (which goes only to the trace log)
	// and DfwTraceError (which goes both to the trace log and to the
	// debugger if the DbgVerifierDbgPrintOn option is set).

	DfwTraceDbgPrint(DRIVERNAME " - Version %d.%2.2d.%3.3d, %s %s\n",
		VERMAJOR, VERMINOR, BUILD, __DATE__, __TIME__);

	// Setup a driver configuration structure for use as a parameter to a
	// call to DfwDriverCreate. We could use the DFW_DRIVER_CONFIG_INIT
	// macro to help us do this, but (frankly) it doesn't add much value
	// over and above a C-standard initializer. For expository purposes,
	// I'm using explicit assignment statements here to do the initialization.
	// Note that the compiler would generate basically the same code for
	// the DFW_DRIVER_CONFIG_INIT macro, a complete declaration with
	// initializer, and the following. Note also that the presence of any
	// initializer causes the compiler to zero-initialize the remainder of
	// the structure.

	DFW_DRIVER_CONFIG config = {sizeof(DFW_DRIVER_CONFIG)};	// Size -- the size of the structure

	// DeviceExtensionSize is the size of the device extension structure
	// that the framework will allocate for each DFWDEVICE created by this
	// driver. More complex drivers would have a non-empty extension. Still
	// more complex drivers might be creating different types of
	// device object by calling DfwDeviceCreateChild or DfwDeviceCreateControlObject,
	// either of which has an extension-size argument.

	config.DeviceExtensionSize = 0;

	// RequestContextSize is the size of an optional context structure that
	// the framework will create for each DFWREQUEST (i.e., IRP). This
	// driver doesn't explicitly handle any IRPs, so this might as well be zero.

	config.RequestContextSize = 0;

	// Events contains pointers to "event" callback routines. A driver object
	// has two events: DeviceAdd (formerly known as AddDevice) and Unload
	// (formerly known as DriverUnload). The DeviceAdd callback is required,
	// even if it doesn't do anything except initialize a DFWDEVICE object with
	// default parameters.

	config.Events.EvtDriverDeviceAdd = EvtDriverDeviceAdd;

	// An Unload event callback would be needed only to undo any side effects
	// of this DriverEntry routine. There are none in this driver, so we could
	// leave out this callback. I like to see a debug message to tell me that
	// a driver has really unloaded, however, so I'm specifying that callback:

	config.Events.EvtDriverUnload = EvtDriverUnload;

	// No bits had been defined in DriverInitFlags at the time I wrote this
	// sample...

	config.DriverInitFlags = 0;

	// The LockingConfig specifies the synchronization behavior for the
	// whole driver. Since this driver doesn't actually do anything, it
	// hardly matters what we specify here. A plausible choice when you're
	// just starting out is DfwLockingDevice, in which the framework
	// serializes calls to all callbacks related to a particular device
	// object by using a per-device "presentation" lock.

	config.LockingConfig = DfwLockingDevice;

	// The ThreadingConfig specifies whether event callbacks to this driver
	// should be allowed to block their calling thread (synchronous) or
	// not (asynchronous). The preferred choice is asynchronous, which implies
	// use of a spin lock to synchronize event callbacks at DISPATCH_LEVEL.
	// Note that this behavior is quite a bit different than the regular WDM
	// model, in which driver routines can be called at several different IRQLs
	// and must synchronize using IRQL-appropriate locks.

	config.ThreadingConfig = DfwThreadingAsynchronous;

	// SynchronizationConfig is intended to specify how this driver synchronizes
	// hardware access. There is currently just one choice (None), which implies
	// that the driver has to do it's own interrupt synchronization. There may 
	// someday be another choice for DIRQL-level synchronization as with a WDM interrupt object.

	config.SynchronizationConfig = DfwSynchronizationNone;

	// Invoke DfwDriverCreate to create a framework driver object. The
	// third parameter to this function -- NULL in this example -- is
	// the address of an optional DFW_OBJECT_ATTRIBUTES structure that
	// could be used to specify a context-structure size and a destruction
	// callback. These things would be useful, perhaps, in a single-device
	// driver that kept all of its state information in a "driver extension"
	// structure that needed cleanup. I'm hard pressed to think of a situation
	// when I'd want to use them, though, given that there is an Unload callback.

	DFWDRIVER Driver;
	DFWSTATUS status = DfwDriverCreate(DriverObject, RegistryPath, NULL, 
		&config, &Driver);

	if (!NT_SUCCESS(status))
		DfwTraceError(DRIVERNAME " - DfwDriverCreate failed - %X\n", status);

	// Return the status code from DfwDriverCreate.

	return status;
	}							// DriverEntry

////////////////////////////////////////////////////////////////////////////////
// The framework calls EvtDriverDeviceAdd to initialize a new device object.

#pragma LOCKEDCODE

DFWSTATUS EvtDriverDeviceAdd(DFWDRIVER hDriver, DFWDEVICE hDevice)
	{							// EvtDriverDeviceAdd
	DfwTraceDbgPrint(DRIVERNAME " - EvtDriverDeviceAdd entered - IRQL is %d\n", KeGetCurrentIrql());
	DFWSTATUS status;

	// In a more complex driver, we would do many things in this function. For example,
	// prior to calling DfwDeviceInitialize, we might:
	//	.Call DfwDeviceSetDeviceName to establish the name for the DEVICE_OBJECT
	//	.Call DfwDeviceSetDeviceType to establish the type for the DEVICE_OBJECT
	//	.Call DfwDeviceSetDeviceCharacteristics to establish the characteristics flags for the DEVICE_OBJECT
	//	.Call DfwDeviceSetExclusive to establish the Exclusive flag to be used in the eventual call to IoCreateDevice.

	// DfwDeviceInitialize will, among other things, call IoCreateDevice.

	status = DfwDeviceInitialize(hDevice);
	if (!NT_SUCCESS(status))
		{
		DfwTraceError(DRIVERNAME " - DfwDeviceInitialize failed - %X\n", status);
		return status;
		}

	// In a more complex driver, we might now do these additional things:
	//	.Call DfwDeviceCreateDeviceInterface to register a device interface GUID.
	//	.Call one or more functions like DfwDeviceRegisterCallbacks to establish
	//	 event callbacks for various types of IRP.
	//	.Create one or more DFWQUEUE request queues.

	// Even though we don't want to do anything special with PnP IRPs, the WinHEC 2003
	// version of the DFW library requires us to call DfwDeviceRegisterFdoCallbacks, or else
	// it crashes when we unload the driver.

	DFW_FDO_EVENT_CALLBACKS callbacks;
	DFW_FDO_EVENT_CALLBACKS_INIT(&callbacks);

	status = DfwDeviceRegisterFdoCallbacks(hDevice, &callbacks);
	if (!NT_SUCCESS(status))
		{
		DfwTraceError(DRIVERNAME " - DfwDeviceRegisterFdoCallbacks failed - %X\n", status);
		return status;
		}

	return status;
	}							// EvtDriverDeviceAdd

////////////////////////////////////////////////////////////////////////////////
// The framework calls EvtDriverUnload to do any required cleanup of global
// variables in preparation for unloading the driver. This driver has no
// cleanup to perform, so this routine is here just to print a reassuring
// debug message.

#pragma PAGEDCODE

VOID EvtDriverUnload(DFWDRIVER Driver)
	{							// EvtDriverUnload
	PAGED_CODE();
	DfwTraceDbgPrint(DRIVERNAME " - Unloading driver - IRQL is %d\n", KeGetCurrentIrql());
	}							// EvtDriverUnload

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
图片区小说区区亚洲影院| 国产精品中文有码| 国产乱国产乱300精品| 一本大道av伊人久久综合| 久久久精品中文字幕麻豆发布| 亚洲主播在线播放| 欧洲一区二区三区免费视频| 国产欧美综合在线观看第十页| 久久99精品国产.久久久久 | 欧美三级日韩三级| 中文字幕一区不卡| 一本一道综合狠狠老| 国产精品久久久久久久浪潮网站| 国产一区二区在线观看视频| 精品国产1区2区3区| 国产精品77777竹菊影视小说| 精品毛片乱码1区2区3区| 男人的天堂亚洲一区| 91精品国产综合久久久蜜臀粉嫩| 亚洲欧洲精品天堂一级 | 精品一区二区精品| 久久久久久久一区| 成人app在线观看| 亚洲一区中文在线| 日韩美女视频在线| a4yy欧美一区二区三区| 亚洲va中文字幕| 制服视频三区第一页精品| 久久国产精品99久久久久久老狼 | 成人免费视频网站在线观看| 亚洲在线中文字幕| 国产人成一区二区三区影院| 91日韩一区二区三区| 日本视频在线一区| 一区二区三区免费看视频| 日韩三级视频中文字幕| 91在线一区二区| 亚洲在线视频网站| 欧美v亚洲v综合ⅴ国产v| 色婷婷av久久久久久久| 国产一区二区剧情av在线| 一区二区三区成人| 国产精品美日韩| 欧美日韩一区二区三区在线| 粉嫩aⅴ一区二区三区四区五区| 一区二区成人在线视频| 国产精品免费观看视频| 337p日本欧洲亚洲大胆精品| 欧美日韩国产在线观看| 色偷偷久久一区二区三区| 东方欧美亚洲色图在线| 九九在线精品视频| 久久精品国产亚洲高清剧情介绍 | 久久久天堂av| 欧美电影免费观看高清完整版在线| 欧美群妇大交群中文字幕| 91麻豆精东视频| 在线精品视频小说1| 美国十次综合导航| 亚洲国产综合视频在线观看| 亚洲三级在线观看| 一区二区三区美女视频| 亚洲福利一区二区| 免费精品99久久国产综合精品| 丝袜亚洲另类丝袜在线| 日本不卡中文字幕| 国产伦精品一区二区三区免费迷 | 99精品热视频| 欧美日韩另类国产亚洲欧美一级| 在线免费一区三区| 这里只有精品免费| 国产欧美日韩另类一区| 亚洲手机成人高清视频| 午夜精品久久久久久久蜜桃app| 免费在线欧美视频| 99久久久久久99| 欧美日韩免费高清一区色橹橹| 久久aⅴ国产欧美74aaa| 久久午夜免费电影| 一区二区三区四区在线| 美女在线一区二区| 欧美影视一区二区三区| 日韩限制级电影在线观看| 国产日韩欧美在线一区| 亚洲综合一二三区| 风间由美中文字幕在线看视频国产欧美 | av亚洲精华国产精华| 日韩视频一区在线观看| 亚洲综合色区另类av| 国产老女人精品毛片久久| 91成人在线观看喷潮| 国产精品女人毛片| 国内精品写真在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 国产91高潮流白浆在线麻豆 | 99re热这里只有精品免费视频| 欧美国产国产综合| 一区二区三区 在线观看视频| 亚洲国产成人在线| 久久久久亚洲综合| 亚洲午夜免费电影| 精品毛片乱码1区2区3区| 尤物在线观看一区| 日本电影亚洲天堂一区| 亚洲精品免费在线观看| 91蜜桃网址入口| 亚洲人成网站色在线观看| 成人av电影免费观看| 最新中文字幕一区二区三区| 成人精品视频一区| 亚洲欧洲日韩av| 99久久精品免费| 自拍偷自拍亚洲精品播放| 在线欧美小视频| 亚洲午夜免费视频| 欧美三级电影网站| 五月综合激情婷婷六月色窝| 6080国产精品一区二区| 久久99久久99| 国产精品网站一区| 欧美精品久久99久久在免费线| 日韩和的一区二区| 国产精品福利一区| 欧美精品粉嫩高潮一区二区| 黄网站免费久久| 国产欧美日本一区视频| 99精品视频在线播放观看| 亚洲bt欧美bt精品777| 国产色产综合色产在线视频| 91在线云播放| 国产精品911| 天天av天天翘天天综合网色鬼国产| 欧美一级片在线| 色婷婷国产精品久久包臀| 激情久久久久久久久久久久久久久久| 国产亚洲一本大道中文在线| 精品视频在线免费| 99久久精品久久久久久清纯| 日本不卡视频一二三区| 亚洲欧美色图小说| 中文字幕高清一区| 国产日韩欧美综合一区| 精品va天堂亚洲国产| 欧美久久婷婷综合色| 欧美亚洲动漫另类| 色综合久久中文字幕| 成人av电影在线播放| 国产一区 二区 三区一级| 国内成+人亚洲+欧美+综合在线| 亚洲在线免费播放| 亚洲免费视频成人| 亚洲免费av高清| 国产网站一区二区| 日韩欧美一卡二卡| 欧美精品一区二| 国产亚洲精品超碰| 中文字幕第一区| 中文字幕亚洲在| 亚洲曰韩产成在线| 亚洲综合在线第一页| 亚洲第一主播视频| 日本强好片久久久久久aaa| 日本va欧美va欧美va精品| 免费观看久久久4p| 久99久精品视频免费观看| 国产成人在线观看免费网站| 日本乱人伦aⅴ精品| 欧美在线短视频| 欧美videossexotv100| 日本一区二区综合亚洲| 亚洲最大色网站| 国产乱人伦偷精品视频免下载 | 26uuu久久天堂性欧美| 国产精品久久三| 亚洲国产精品人人做人人爽| 国产麻豆精品95视频| 欧美午夜精品久久久久久超碰| 欧美成人激情免费网| 自拍偷拍国产精品| 韩国女主播成人在线| 久久 天天综合| 91在线观看免费视频| 日韩一区二区在线观看视频播放| 国产精品婷婷午夜在线观看| 亚洲一区在线看| 成人视屏免费看| 久久网站热最新地址| 午夜日韩在线电影| 色视频欧美一区二区三区| 久久丝袜美腿综合| 日韩av中文字幕一区二区三区| 91色在线porny| 国产欧美综合色| 国模冰冰炮一区二区| 91精品国产一区二区三区香蕉| 一区二区三区日韩精品| 91在线视频播放地址| 中文av一区二区| 国产99久久久精品| 国产精品久久福利|