ObInitはTRUEとFALSE時間がObpInitializationPhaseあり、二回呼び出されます。
ときObpInitializationPhase == TURE、ルートディレクトリの\を作成し、\ ObjectTypes
ObpInitializationPhaseは== FALSE、ObCreateObjectTypeを呼び出すときに、タイプの下に\ ObjectTypesを作成し、ディレクトリ、SymbolicLinkなど。
ルートディレクトリ\と\ ObjectTypes
ObInit()
{
...
// ルートディレクトリを作成します\
/ *ディレクトリ*作成/
ステータス= NtCreateDirectoryObject(&ハンドル、
DIRECTORY_ALL_ACCESS、
&ObjectAttributes)。
...
//将句柄转换成对象
ステータス= ObReferenceObjectByHandle(ハンドル、
0、
ObDirectoryType、
KernelMode、
(PVOID *)&ObpRootDirectoryObject、
NULL);
...
// 创建根目录\ ObjectTypes
ステータス= NtCreateDirectoryObject(&ハンドル、
DIRECTORY_ALL_ACCESS、
&ObjectAttributes)。
...
/ *それにハンドルを取得します* /
ステータス= ObReferenceObjectByHandle(ハンドル、
0、
ObDirectoryType、
KernelMode、
(PVOID *)&ObpTypeDirectoryObject、
NULL);
...
}
ます。https://www.cnblogs.com/fanzi2009/archive/2010/02/10/1667194.htmlで再現