Okay, I am going to write an article for CodeGuru.com, and for that I needed to find out name of file, associated with handle. But I want to keep the topic private to myself, till I write and submit for posting.
Okay, I am going to write an article for CodeGuru.com, and for that I needed to find out name of file, associated with handle. But I want to keep the topic private to myself, till I write and submit for posting.
Well, We'll wait for your article...
BTW, the link you provided is wrong.
One thing! I've not written a single word for the article as of now. May take few days to finish.
The article (on multithreading), that I've already submitted for posting isn't the one I am working on.
I got the HANDLE to a file, and I need to find the filename associated.
I don't want to use NtQueryInformationFile
Sounds... like not very reasonable. Afraid you have no other choice. I wouldn't be surprised if I found out that GetMappedFileName uses NtQueryInformationFile internally.
Besides, I'd like to hear about the reason of such a dislike to a very basic API. (Please, don't tell me it's just because the approach is not a brand new one. )
Because it's an undocumented function. Not mentioned anywhere in MSDN. I found it under undocumented.ntinternals.net. Further to that, other similar APIs (like NtQueryInformationProcess), says something in MSDN:
Originally Posted by MSDN
[NtQueryInformationProcess may be altered or unavailable in future versions of Windows. Applications should use the alternate functions listed in this topic.]
I am still a user-mode programmer, I cannot think of these APIs till I start with kernel-mode programming!
I am still a user-mode programmer, I cannot think of these APIs till I start with kernel-mode programming!
That's too bad. I am a user-mode programmer too, and I never stop thinking of the NtXxxx functions, as they are legal portals from user mode to kernel mode.
Bookmarks