1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

cp: use CreateFileW to increase legacy windows compatiblity

This commit is contained in:
Roy Ivy III 2019-12-07 18:59:29 -06:00
parent 2dad625dfa
commit 55209c6490

View file

@ -29,7 +29,7 @@ extern crate kernel32;
#[cfg(windows)]
use kernel32::GetFileInformationByHandle;
#[cfg(windows)]
use kernel32::CreateFile2;
use kernel32::CreateFileW;
#[cfg(windows)]
extern crate winapi;
@ -731,10 +731,12 @@ fn preserve_hardlinks(
#[cfg(windows)]
{
let stat = mem::uninitialized();
let handle = CreateFile2(
let handle = CreateFileW(
src_path.as_ptr() as *const u16,
winapi::um::winnt::GENERIC_READ,
winapi::um::winnt::FILE_SHARE_READ,
std::ptr::null_mut(),
0,
0,
std::ptr::null_mut(),
);