ObOpenObjectByPointer for usermode access handle

hi, all!
i have next problem. i have file_object from irp and want to get handle in the context of some process. i use
ObOpenObjectByPointer(pFileObj,0 ,NULL,FILE_READ_DATA,*IoFileObjectType,UserMode,&hFileHandle);
for this purpose. but can’t get handle for user mode. it is usable only in kernel.
can anybody help me?

You should NOT take an object created in kernel mdoe and create a handle for it so that it can be accessed by the user mode process. Doing so is a big security hole. The user mode process gets a handle without any security checks applied. The user mode process should create the object by calling CreateFile.


Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.

“Sasha Dolgopolov” wrote in message news:xxxxx@ntdev…

hi, all!
i have next problem. i have file_object from irp and want to get handle in the context of some process. i use
ObOpenObjectByPointer(pFileObj,0 ,NULL,FILE_READ_DATA,*IoFileObjectType,UserMode,&hFileHandle);
for this purpose. but can’t get handle for user mode. it is usable only in kernel.
can anybody help me?