Initializing a Callout Driver
来源:互联网 发布:juniper networks mac 编辑:程序博客网 时间:2024/06/01 16:05
A callout driver initializes itself within its DriverEntry function. The main initialization tasks are as follows:
callout driver在DriverEntry函数中初始化自己,主要的初始化功能如下:
- Specifying an Unload Function
- Creating a Device Object
- Registering Callouts with the Filter Engine
If a callout driver is based on WDM, it specifies an Unload function in its DriverEntry function. For example:
Unload(
IN PDRIVER_OBJECT DriverObject
);
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
...
DriverObject->DriverUnload = Unload;
}
If a callout driver is based on WDM, it creates a device object by calling the IoCreateDevice function. For example:
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
NTSTATUS status;
status =
IoCreateDevice(
DriverObject,
0,
NULL,
FILE_DEVICE_UNKNOWN,
FILE_DEVICE_SECURE_OPEN,
FALSE,
&deviceObject
);
}
Registering Callouts with the Filter Engine
After a callout driver has created a device object, it can then register its callouts with the filter engine. A callout driver can register its callouts with the filter engine at any time, even if the filter engine is currently not running. To register a callout with the filter engine, a callout driver calls the FwpsCalloutRegister0 function. For example:
callout driver在创建完设备对象后,就可以注册它的callouts了。callout driver可以在任意时候注册callouts,甚至在过滤引擎没有运行时。为了注册callout,驱动调用FwpsCalloutRegister0函数。
VOID NTAPI
ClassifyFn(
IN const FWPS_INCOMING_VALUES0 *inFixedValues,
IN const FWPS_INCOMING_METADATA_VALUES0 *inMetaValues,
IN OUT VOID *layerData,
IN const FWPS_FILTER0 *filter,
IN UINT64 flowContext,
OUT FWPS_CLASSIFY_OUT0 *classifyOut
);
NTSTATUS NTAPI
NotifyFn(
IN FWPS_CALLOUT_NOTIFY_TYPE notifyType,
IN const GUID *filterKey,
IN const FWPS_FILTER0 *filter
);
VOID NTAPI
FlowDeleteFn(
IN UINT16 layerId,
IN UINT32 calloutId,
IN UINT64 flowContext
);
// Callout registration structure
const FWPS_CALLOUT0 Callout =
{
{ ... }, // GUID key identifying the callout
0, // Callout-specific flags (none set here)
ClassifyFn,
NotifyFn,
FlowDeleteFn
};
// Variable for the run-time callout identifier
UINT32 CalloutId;
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
PDEVICE_OBJECT deviceObject;
NTSTATUS status;
...
status =
FwpsCalloutRegister0(
deviceObject,
&Callout,
&CalloutId
);
...
return status;
}
If the call to the FwpsCalloutRegister0 function is successful, the variable pointed to by the last parameter contains the run-time identifier for the callout. This run-time identifier corresponds to the GUID that was specified for the callout key.
调用FwpsCalloutRegister0成功后,最后一个参数包含一个运行时标识符,这个运行时标识符于callout key对应。
A single callout driver can implement more than one callout. If a callout driver implements more than one callout, it calls theFwpsCalloutRegister0 function one time for each callout that it supports to register each callout with the filter engine.
- Initializing a Callout Driver
- Initializing a Build Environment
- Initializing a Build Environment
- Initializing a Build Environment
- Initializing a Build Environment
- Initializing the Oracle ASMLib driver: [FAILED]
- Initializing the Oracle ASMLib driver: [FAILED]
- ORACLE Initializing the Oracle ASMLib driver: [FAILED]
- android Initializing a Build Environment
- Android Initializing a Build Environment
- list initializing a vector demo
- SharePoint debug : launchPoint given is already associated with a callout
- Using a Callout for Deep Inspection of Stream Data
- oracle ASM错误Initializing the Oracle ASMLib driver:[FAILED]
- 关于“Initializing the Oracle ASMLib driver: [FAILED]”的解决办法
- oracle ASM错误Initializing the Oracle ASMLib driver:[FAILED]
- 关于“Initializing the Oracle ASMLib driver: [FAILED]”的解决办法
- 解决ASM问题“Initializing the Oracle ASMLib driver: failed”
- C++如何设计一个含指针的类(Boolan笔记第二周)
- 二叉树的前序、中序、后序遍历
- IAP与APP互相跳转的实现
- 设计模式六大原则(2):里氏替换原则
- git命令使用-patch
- Initializing a Callout Driver
- 在xcode8中使用真机调试错误解决办法
- vue中v-for的使用,离不开的数组
- hibernate一对多、多对多级联保存与级联删除与修改外键
- Elasticsearch 5.0版本 学习二、修改数据
- 图像无缝融合研究(一)Poisson Image Editing
- handle.post 跳到主线程中执行
- 详解@SessionAttributes
- requestWindowFeature(Window.FEATURE_NO_TITLE)无效