大网数据广告活动
Windows 系统接口

ObOpenObjectByName function

· 52CE 我爱测

Opens an object with full access validation and auditing.

Opens an object with full access validation and auditing.

Syntax

NTSTATUS
ObOpenObjectByName (
    __in POBJECT_ATTRIBUTES ObjectAttributes,
    __in POBJECT_TYPE ObjectType,
    __in KPROCESSOR_MODE AccessMode,
    __inout_opt PACCESS_STATE AccessState,
    __in_opt ACCESS_MASK DesiredAccess,
    __inout_opt PVOID ParseContext,
    __out PHANDLE Handle
    )

Parameters

ObjectAttributes [in]

A pointer to an OBJECT_ATTRIBUTES structure representing the object attributes.

ObjectType [in]

The object type. The OBJECT_TYPE structure has the following definition:

typedef struct _OBJECT_TYPE {
    LIST_ENTRY TypeList;
    UNICODE_STRING Name;            
    PVOID DefaultObject;
    UCHAR Index;
    __volatile ULONG TotalNumberOfObjects;
    __volatile ULONG TotalNumberOfHandles;
    ULONG HighWaterNumberOfObjects;
    ULONG HighWaterNumberOfHandles;
    OBJECT_TYPE_INITIALIZER TypeInfo;
    EX_PUSH_LOCK TypeLock;
    ULONG Key;
} OBJECT_TYPE, *POBJECT_TYPE;

AccessMode [in]

The processor mode of the access. The KPROCESSOR_MODE is defined with the following values:

typedef enum _KPROCESSOR_MODE {
    KernelMode,
    UserMode,
    MaximumMode
} KPROCESSOR_MODE;

AccessState [in, out, optional]

An optional pointer to an ACCESS_STATE representing the current access status describing already granted access types, the privileges used to get them, and any access types yet to be granted.

DesiredAccess [in, optional]

An ACCESS_MASK representing the desired access to the object.

ParseContext [in, out, optional]

An optional pointer to parse context data.

Handle [out]

Receives pointer to a variable that receives the handle value.

Return value

S_OK on success.

Remarks

This function is not defined in an SDK header and must be declared by the caller. This function is exported from ntoskrnl.exe.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows 10
DLL ntoskrnl.exe

See also

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 03/02/2023
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。