NtCreateFile from file index ID

Hi there,

I have been trying (unsuccessfully) to call NtCreateFile using the handle of a shared directory opened by CreateFile (which works fine) and a file index ID which was returned from NtQueryDirectoryFile.

Whatever permutations of the NtCreateFile API I call always returns NOT_SUPPORTED. I’m using code based on the following: http://www.ragestorm.net/blogs/?p=186 but running it from a .Net application via PInvoke.

Could someone please tell me if it’s even possible for me to open a file based on File Index ID using a parent directory which is shared?

Thank you very much in advance,


I’ve been playing with this a little more, and it looks like that you simply cannot open a file based on the file index ID from a share.

Every other permutation works (opening with a file index ID with a local file, opening with a name rather than a file index ID on a remote file) but using the index doesn’t work.

Hopefully this will save someone else’s time :slight_smile: