Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ internal static partial class Interop
{
internal static unsafe partial class Windows
{
[LibraryImport("api-ms-win-core-file-l2-1-0.dll", EntryPoint = "CreateHardLinkW", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport("api-ms-win-core-file-l2-1-0.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CreateHardLink(string name, string existingFileName, nint securityAttributes);
private static partial bool CreateHardLinkW(string lpFileName, string lpExistingFileName, void* lpSecurityAttributes);

internal static bool CreateHardLink(string fileName, string existingFileName)
{
return CreateHardLinkW(fileName, existingFileName, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ protected override void NewItem(
#if UNIX
success = Platform.NonWindowsCreateHardLink(path, strTargetPath);
#else
success = Interop.Windows.CreateHardLink(path, strTargetPath, IntPtr.Zero);
success = Interop.Windows.CreateHardLink(path, strTargetPath);
#endif
}

Expand Down