@@ -712,11 +712,11 @@ impl<'a> Iterator for DirBuffIter<'a> {
712
712
713
713
/// Open a link relative to the parent directory, ensure no symlinks are followed.
714
714
fn 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
716
716
// unfortunately opening a file relative to a parent is not supported by
717
717
// win32 functions. It is however a fundamental feature of the NT kernel.
718
718
//
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
720
720
unsafe {
721
721
let mut handle = ptr:: null_mut ( ) ;
722
722
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<
732
732
Attributes : ATTRIBUTES . load ( Ordering :: Relaxed ) ,
733
733
..c:: OBJECT_ATTRIBUTES :: default ( )
734
734
} ;
735
- let status = c:: NtOpenFile (
735
+ let status = c:: NtCreateFile (
736
736
& mut handle,
737
737
access,
738
738
& object,
739
739
& mut io_status,
740
+ crate :: ptr:: null_mut ( ) ,
741
+ 0 ,
740
742
c:: FILE_SHARE_DELETE | c:: FILE_SHARE_READ | c:: FILE_SHARE_WRITE ,
743
+ c:: FILE_OPEN ,
741
744
// If `name` is a symlink then open the link rather than the target.
742
745
c:: FILE_OPEN_REPARSE_POINT ,
746
+ crate :: ptr:: null_mut ( ) ,
747
+ 0 ,
743
748
) ;
744
749
// Convert an NTSTATUS to the more familiar Win32 error codes (aka "DosError")
745
750
if c:: nt_success ( status) {
0 commit comments