惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
罗磊的独立博客
B
Blog
博客园_首页
A
About on SuperTechFans
有赞技术团队
有赞技术团队
V
V2EX
U
Unit 42
I
InfoQ
IT之家
IT之家
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
H
Help Net Security

博客园 - bqrm_521(小奎)

.net连接eDirectory,需要安全连接的解决方案 ObDereferenceObjectDeferDelete routine ObDereferenceObject routine ObCloseHandle routine InitializeObjectAttributes 宏 Driver Support Routines(驱动程序开发支持例程) AdapterControl routine Standard Driver Routines(标准驱动程序) 文件系统过滤驱动的DriverEntry PHP扩展的加载流程 PHP扩展中定义一个类 PHP的HashTable(二) PHP的HashTable(一) PHP扩展中访问全局变量$_POST,$_GET,$_SERVER等 开发PHP扩展(一) 要搬家了,全部书籍10元转让 scribe2.2 ssh 使用技巧 安装scribe
DriverEntry
bqrm_521(小奎) · 2013-05-29 · via 博客园 - bqrm_521(小奎)

DriverEntry is the first routine called after a driver is loaded, and is responsible for initializing the driver.

DriverEntry是驱动加载后第一个执行的例程,它负责初始化驱动程序。

语法:

DRIVER_INITIALIZE DriverEntry;

NTSTATUS DriverEntry(
_In_ struct _DRIVER_OBJECT *DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
{ ... }

参数:
DriverObject [in]
A pointer to a DRIVER_OBJECT structure. This is the driver's driver object.
一个DRIVER_OBJECT结构体的指针,是驱动程序的驱动对象。
RegistryPath [in]
A pointer to a counted Unicode string specifying the path to the driver's registry key.
一个UNICODE字符串,指定驱动程序在注册表中对应的键值。
返回值:

If the routine succeeds, it must return STATUS_SUCCESS. Otherwise, it must return one of the error status values defined in Ntstatus.h.
如果执行成功,必须返回STATUS_SUCCESS, 其它情况下,返回ntstatus.h定义的错误码。

其它说明:

The DriverObject parameter supplies the DriverEntry routine with a pointer to the driver's driver object, which is allocated by the I/O manager.
DriverEntry程的DriverObject参数是一个由IO管理器分配的指向驱动程序的驱动对象指针。
The DriverEntry routine must fill in the driver object with entry points for the driver's standard routines.
DriverEntry必须指定驱动程序的标准例程的入口点。
The DriverObject pointer gives the driver access to DriverObject->HardwareDatabase,
驱动程序通过DriverObject->HardwareDatabase(一个UNICODE字符串)访问\Registry\Machine\Hardware子树。
which points to a counted Unicode string that specifies a path to the registry's \Registry\Machine\Hardware tree.

The registry path string pointed to by RegistryPath is of the form \Registry\Machine\System\CurrentControlSet\Services\DriverName.
RegistryPath是一个指向\Registry\Machine\System\CurrentControlSet\Services\DriverName注册表路径的UNICODE字符串,

A driver can use this path to store driver-specific information; see Registry Keys for Drivers.
驱动程序可以使用注册表保存一些驱动程序的配置信息。

The DriverEntry routine should save a copy of the Unicode string,
not the pointer, since the I/O manager frees the RegistryPath buffer after DriverEntry returns.
DriverEntry应该保存一个UNICODE字符串(如果以后会用到),而不是指针,因为I/O管理器在它返回后会释放RegisterPath。

While it is possible to name this routine something other than DriverEntry, doing so is not recommended.
虽然这个入口函数可以使用其它的名字,但不推荐这么做。

The DDK-supplied build tools automatically inform the linker that the driver's entry point is called DriverEntry,
so giving the routine another name requires you to modify the build tools.
DDK提供的build工具默认使用DriverEntry这个入口函数进行链接,所以,使用其它的入口函数名称,需要你修改build工具的参数。