diff --git a/VaraniumSharp.FileTransferManager/VaraniumSharp.FileTransferManager.csproj b/VaraniumSharp.FileTransferManager/VaraniumSharp.FileTransferManager.csproj index 05d338e..f456fba 100644 --- a/VaraniumSharp.FileTransferManager/VaraniumSharp.FileTransferManager.csproj +++ b/VaraniumSharp.FileTransferManager/VaraniumSharp.FileTransferManager.csproj @@ -27,12 +27,12 @@ - 6.8.0 + 6.14.0 runtime; build; native; contentfiles; analyzers; buildtransitive all - + \ No newline at end of file diff --git a/VaraniumSharp.FileTransferManager/Workers/FileTransferManager.cs b/VaraniumSharp.FileTransferManager/Workers/FileTransferManager.cs index edd7d1c..76ff99e 100644 --- a/VaraniumSharp.FileTransferManager/Workers/FileTransferManager.cs +++ b/VaraniumSharp.FileTransferManager/Workers/FileTransferManager.cs @@ -142,7 +142,7 @@ public static TransferResult MoveWithProgress(string source, string destination, return TransferResult.Cancelled; } - if (!NativeMethods.MoveFileWithProgress(source, destination, lpProgressRoutine, IntPtr.Zero, NativeMethods.MoveFileFlags.MOVE_FILE_REPLACE_EXISTING | NativeMethods.MoveFileFlags.MOVE_FILE_COPY_ALLOWED | NativeMethods.MoveFileFlags.MOVE_FILE_WRITE_THROUGH)) + if (!NativeMethods.MoveFileWithProgressW(source, destination, lpProgressRoutine, IntPtr.Zero, NativeMethods.MoveFileFlags.MOVE_FILE_REPLACE_EXISTING | NativeMethods.MoveFileFlags.MOVE_FILE_COPY_ALLOWED | NativeMethods.MoveFileFlags.MOVE_FILE_WRITE_THROUGH)) { if (cancellationToken.IsCancellationRequested) { @@ -301,7 +301,7 @@ private static TransferResult CopyFileWithProgress(string sourceFile, string new // TODO - Why is this done? var ctr = cancellationToken.Register(() => pbCancel = 1); - var result = NativeMethods.CopyFileEx(sourceFile, newFile, lpProgressRoutine, IntPtr.Zero, ref pbCancel, NativeMethods.CopyFileFlags.COPY_FILE_FAIL_IF_EXISTS); + var result = NativeMethods.CopyFileExW(sourceFile, newFile, lpProgressRoutine, IntPtr.Zero, ref pbCancel, NativeMethods.CopyFileFlags.COPY_FILE_FAIL_IF_EXISTS); if (cancellationToken.IsCancellationRequested) { return TransferResult.Cancelled; diff --git a/VaraniumSharp.FileTransferManager/Workers/NativeMethods.cs b/VaraniumSharp.FileTransferManager/Workers/NativeMethods.cs index 0b708c4..e3d4083 100644 --- a/VaraniumSharp.FileTransferManager/Workers/NativeMethods.cs +++ b/VaraniumSharp.FileTransferManager/Workers/NativeMethods.cs @@ -11,10 +11,10 @@ internal static class NativeMethods [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CopyFileEx(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, ref int pbCancel, CopyFileFlags dwCopyFlags); + internal static extern bool CopyFileExW(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, ref int pbCancel, CopyFileFlags dwCopyFlags); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool MoveFileWithProgress(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, MoveFileFlags dwCopyFlags); + internal static extern bool MoveFileWithProgressW(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, MoveFileFlags dwCopyFlags); #endregion