How to create a thread-independent file handle?

In my sfilter-alike driver, I need to keep a file handle created by ZwCreateFile to globally seeable by different thread/irp. Now I always got STATUS_INVALID_HANDLE_VALUE when I use a file handle created in some other thread/irp. Any suggestion?

Specify OBJ_KERNEL_HANDLE, those are visible in all processes
(ofcourse in kernel mode only)

??2007-06-27??“Ladislav Zezula” д???
Specify OBJ_KERNEL_HANDLE, those are visible in all processes (ofcourse in kernel mode only) — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: liyuncheng@163.com To unsubscribe send a blank email to xxxxx@lists.osr.com

Sorry for last empty reply.

I’ve already specified OBJ_KERNEL_HANDLE, but ZwReadFile still returns STATUS_INVALID_HANDLE. What possibly cause that? Thx.

Use OBJ_KERNEL_HANDLE in InitializeObjectAttributes before ZwCreateFile.
This works from w2k up, does NOT work on NT4.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntfsd…
> In my sfilter-alike driver, I need to keep a file handle created by
ZwCreateFile to globally seeable by different thread/irp. Now I always got
STATUS_INVALID_HANDLE_VALUE when I use a file handle created in some other
thread/irp. Any suggestion?
>