Get hardlink filename

Hello All,

When hardlink of file a.txt(for example b.txt) is created IRP IRP_MJ_SET_INFORMATION FileLinkInformation is triggered. How can i obtain hardlink file name?

  • get fileid (call IRP_MJ_QUERY_INFORMATION/FileInternalInformation)
  • open file with FILE_OPEN_BY_FILE_ID flag
  • get its filename (call IRP_MJ_QUERY_INFORMATION/FileNameInformation)

Petr

wrote in message news:xxxxx@ntfsd…
> Hello All,
>
> When hardlink of file a.txt(for example b.txt) is created IRP IRP_MJ_SET_INFORMATION FileLinkInformation is triggered. How can i obtain hardlink file name?
>

Function “FltGetDestinationFileNameInformation” should do the job i want…

Not GO with FltGetDestinationFileNameInformation :frowning: i get path without file name, maybe im doing something wrong.

Petr, i do not understand your procedure completely. Why do you think that the file name will be hard link file name(my case b.txt) and no a.txt. Because when IRP_MJ_QUERY_INFORMATION with FileLinkInformation is triggered there is a.txt file name and there is no any trace of b.txt. And i think that with your procedure i will get again a.txt.