NtQueryObject 函数

来源:互联网 发布:淘宝镜子自拍模特设备 编辑:程序博客网 时间:2024/05/20 06:29

若翻译出现错误,请指出,本人会即时改正。

这个函数未来可能会改变或者从windows中移除,但是不会通告你。(微软有多贱,我嘞个草了)

函数声明:

NTSTATUS NtQueryObject(

_In_opt_  HANDLE  Handle,

_In_        OBJECT_INFORMATION_CLASS objectInformationClass,

_Out_opt_ PVOID   ObjectInformation,

_In_ ULONG ObjectInformationLength,

_Out_opt_ PULONG ReturnLength

);

参数:

Handle  [IN]

需要查询信息对象的句柄,可以为NULL

ObjectInformationClass [IN]

下列枚举类型中的某个值,指出被索引对象的类型。

typedef enum _OBJECT_INFORMATION_CLASS{

ObjectBasicInformation,  

ObjectNameInformation,

ObjectTypeInformation,

ObjectAllInformation,

ObjectDataInformation

}OBJECT_INFORMATION_CALSS,*POBJECT_INFORMATION_CLASS;

ObjectInformation[out]

指向存放返回信息缓冲区的指针。大小和信息存放格式依赖于ObjectInformationClass参数。

ObjectBasicInformation 对应结构为:OBJECT_BASIC_INFORMATION

ObjectNameInformation 对应结构为:OBJECT_NAME_INFORMATION

ObjectTypeInformation  对应结构为:OBJECT_TYPE_INFORMATION

ObjectAllInformation  对应结构为:   OBJECT_ALL_INFORMATION

ObjectDataInformation对应结构为:  OBJECT_DATA_INFORMATION

具体结构体细节,请参考链接:

http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FType%20independed%2FNtQueryObject.html

ObjectInformationLength [IN]

ObjectInformation参数的字节大小

ReturnLength[out]

返回信息需要空间的大小。如果此值小于或等于ObjectInformationLength的值,函数将信息复制到缓冲区中,否则函数返回NTSTATUS错误码,并将信息需要的字节数放入ReturnLength中。

返回值:

返回NTSTATUS或错误码

NTSTATUS的格式和意义在WDK的Ntstatus.h中列出,并在WDK文档中被形容。

参考原文链接:

链接一:

https://msdn.microsoft.com/en-us/library/bb432383(v=vs.85).aspx

链接二:

http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FType%20independed%2FNtQueryObject.html


0 0
原创粉丝点击