Obtain st_nlink without calling CreateFile

I wish to obtain the number of hardlinks to a specific file, but due to access limitations we are not always able to obtain a handle to the file. That is, GetFileAttributes succeeds but CreateFile fails with one of a couple reasons.

Our product needs to know all of the links to a specific file to avoid data corruption. Currently it will attempt to write to both links simultaneously, causing us to write to the file twice. This corrupts the file.

How can I get the number of hard links to a file without opening it? Is there something in the UMDK or KMDK or something in the FILE_OBJECT I can use?

July 8th, 2013 2:31pm

Ask this in MSDN Developer forums:


http://social.msdn.microsoft.com/Forums/en-US/category/windowsdesktopdev

Free Windows Admin Tool Kit Click here and download it now
July 8th, 2013 3:18pm

Thank you. I was looking for the right place for this and had difficulty finding one.
July 8th, 2013 6:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics