@@ -712,11 +712,11 @@ impl<'a> Iterator for DirBuffIter<'a> {
712712
713713/// Open a link relative to the parent directory, ensure no symlinks are followed.
714714fn open_link_no_reparse ( parent : & File , name : & [ u16 ] , access : u32 ) -> io:: Result < File > {
715- // This is implemented using the lower level `NtOpenFile ` function as
715+ // This is implemented using the lower level `NtCreateFile ` function as
716716 // unfortunately opening a file relative to a parent is not supported by
717717 // win32 functions. It is however a fundamental feature of the NT kernel.
718718 //
719- // See https://docs.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntopenfile
719+ // See https://docs.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile
720720 unsafe {
721721 let mut handle = ptr:: null_mut ( ) ;
722722 let mut io_status = c:: IO_STATUS_BLOCK :: default ( ) ;
@@ -732,14 +732,19 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
732732 Attributes : ATTRIBUTES . load ( Ordering :: Relaxed ) ,
733733 ..c:: OBJECT_ATTRIBUTES :: default ( )
734734 } ;
735- let status = c:: NtOpenFile (
735+ let status = c:: NtCreateFile (
736736 & mut handle,
737737 access,
738738 & object,
739739 & mut io_status,
740+ crate :: ptr:: null_mut ( ) ,
741+ 0 ,
740742 c:: FILE_SHARE_DELETE | c:: FILE_SHARE_READ | c:: FILE_SHARE_WRITE ,
743+ c:: FILE_OPEN ,
741744 // If `name` is a symlink then open the link rather than the target.
742745 c:: FILE_OPEN_REPARSE_POINT ,
746+ crate :: ptr:: null_mut ( ) ,
747+ 0 ,
743748 ) ;
744749 // Convert an NTSTATUS to the more familiar Win32 error codes (aka "DosError")
745750 if c:: nt_success ( status) {
0 commit comments