Thursday, June 17, 2010

More GetFinalPathNameByHandle

Yesterday I posted about how GetFinalPathNameByHandle is less than ideal. It doesn't work. Well it works in some situations, but it is unusable in a real world situation. The work around is to create a file map to get the file name but that only works if the handle is to a file that is not zero bytes and is not a directory. So for those cases one must use an undesirable function: NTQueryObject. So it works, for now.

Microsoft, please fix GetFinalPathNameByHandle.

Note: I did all my testing on Windows 7. Your milage on Vista may be different.

No comments:

Post a Comment

Post a Comment