Hi All,
I have seen some discussion on this topic in the past, but generally it is
the other way around, i.e. mapping a kernel handle to a user space handle
(logically you would say well why don’t you just reverse that approach).
So I am enquiring as to whether it is possible to map a user space file
handle (from _open or CreateFile) to a kernel file handle? There are a
number of options available to me but nothing as simple as the equivalent
function in unix, which happens to be getf(). Depending on the platform it
returns something like a vfile.
I have looked at passing down the file name to our file system driver and
then Zwxxx to open the file and use that, but I would like to simplify it
down further…
Thanks,
Ian Costello
SGI R&D Engineer
CXFS MultiOS
Just pass the handle value to kernel mode and use it with the Zw/Nt
family of APIs. As long as you’re in the same process context, this will
work. (Of course this only applies to Win32 HANDLEs, such as from
CreateFile or CreateEvent, not C library constructs).
Ian Costello wrote:
Hi All,
I have seen some discussion on this topic in the past, but generally it is
the other way around, i.e. mapping a kernel handle to a user space handle
(logically you would say well why don’t you just reverse that approach).
So I am enquiring as to whether it is possible to map a user space file
handle (from _open or CreateFile) to a kernel file handle? There are a
number of options available to me but nothing as simple as the equivalent
function in unix, which happens to be getf(). Depending on the platform it
returns something like a vfile.
I have looked at passing down the file name to our file system driver and
then Zwxxx to open the file and use that, but I would like to simplify it
down further…
Thanks,
Ian Costello
SGI R&D Engineer
CXFS MultiOS
–
Nick Ryan
(Microsoft Windows MVP for DDK)
ObOpenObjectByPointer helps.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Ian Costello”
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, January 13, 2004 2:25 AM
Subject: [ntfsd] Mapping a user file handle to a kernel file handle…
> Hi All,
>
> I have seen some discussion on this topic in the past, but generally it is
> the other way around, i.e. mapping a kernel handle to a user space handle
> (logically you would say well why don’t you just reverse that approach).
>
> So I am enquiring as to whether it is possible to map a user space file
> handle (from _open or CreateFile) to a kernel file handle? There are a
> number of options available to me but nothing as simple as the equivalent
> function in unix, which happens to be getf(). Depending on the platform it
> returns something like a vfile.
>
> I have looked at passing down the file name to our file system driver and
> then Zwxxx to open the file and use that, but I would like to simplify it
> down further…
>
> Thanks,
>
> Ian Costello
> SGI R&D Engineer
> CXFS MultiOS
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com