[This is preliminary documentation and subject to change.]
The CreateHardLink function establishes an NTFS hard link between an existing file and a new file. An NTFS hard link is similar to a POSIX hard link.
BOOL CreateHardLink(
LPCTSTR lpFileName,
LPCTSTR lpExistingFileName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
You can use hard links to provide multiple names for the same underlying file. Hard links synchronize updates to the underlying file. Therefore, modifications performed on the existing file are also performed on the new file to which it is linked.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
File Systems Overview, File System Functions, SECURITY_ATTRIBUTES