解决方案 »
- 迷惑中,求解VC和C++
- 请教COM口和Modem是什么关系
- 求教vc中解析html的方法
- 我在做帮助文档的时候遇到问题了,Debug下没问题,Realse就出错了;
- 菜鸟请教!急得吐血!
- ##$$打算转向.net但不知该选择c#还是vc++.net??$$##
- 考考大家的思维如何,一个很有趣味的游戏,不玩会后悔哦 :) 我只到了5-2就做不下去了,哪位兄弟成功了告诉我一下
- 百分急送?有关在程序中加入help文件?
- 菜鸟请大家帮忙:我的串口程序为什么能发送数据但是不能接收数据?
- 串口通信线程与excel读写线程冲突
- 请经验高手解答
- 哪位高手给指点指点:VC中获得一图片像素之后,又由Bitmap::FromBITMAPINFO()函数重新生成位图后,图像发生移动,图像左边一部分跑到位图右侧。
The ObReferenceObjectByHandle routine provides access validation on the object handle, and, if access can be granted, returns the corresponding pointer to the object’s body.NTSTATUS
ObReferenceObjectByHandle(
IN HANDLE Handle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_TYPE ObjectType OPTIONAL,
IN KPROCESSOR_MODE AccessMode,
OUT PVOID *Object,
OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL
);
Parameters
Handle
Specifies an open handle for an object.
DesiredAccess
Specifies the requested types of access to the object. The interpretation of this field is dependent on the object type.
ObjectType
Pointer to the object type. ObjectType can be either *IoFileObjectType or *ExEventObjectType. This parameter can also be NULL if AccessMode is KernelMode.
AccessMode
Specifies the access mode to use for the access check. It must be either UserMode or KernelMode. Lower-level drivers should specify KernelMode.
Object
Pointer to a variable that receives a pointer to the object’s body.
HandleInformation
Drivers set this to NULL.
Return Value
ObReferenceObjectByHandle returns an NTSTATUS value. The possible return values include:STATUS_SUCCESS
STATUS_OBJECT_TYPE_MISMATCH
STATUS_ACCESS_DENIED
STATUS_INVALID_HANDLEHeaders
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.Comments
A pointer to the object body is retrieved from the object table entry and returned to the caller by means of the Object parameter.If the AccessMode parameter is KernelMode, the requested access is always allowed. If AccessMode is UserMode, the requested access is compared to the granted access for the object. Only highest-level drivers can safely specify UserMode for the input AccessMode.If the call succeeds, a pointer to the object body is returned to the caller and the pointer reference count is incremented. Incrementing this count prevents the object from being deleted while the pointer is being referenced. The caller must decrement the reference count with ObDereferenceObject as soon as it is done with the object. Callers of ObReferenceObjectByHandle must be running at IRQL = PASSIVE_LEVEL.