@@ -326,10 +326,15 @@ impl File {
326326 cvt ( c:: GetFileInformationByHandle ( self . handle . as_raw_handle ( ) , & mut info) ) ?;
327327 let mut reparse_tag = 0 ;
328328 if info. dwFileAttributes & c:: FILE_ATTRIBUTE_REPARSE_POINT != 0 {
329- let mut b =
330- Align8 ( [ MaybeUninit :: < u8 > :: uninit ( ) ; c:: MAXIMUM_REPARSE_DATA_BUFFER_SIZE ] ) ;
331- if let Ok ( ( _, buf) ) = self . reparse_point ( & mut b) {
332- reparse_tag = ( * buf) . ReparseTag ;
329+ let mut attr_tag: c:: FILE_ATTRIBUTE_TAG_INFO = mem:: zeroed ( ) ;
330+ cvt ( c:: GetFileInformationByHandleEx (
331+ self . handle . as_raw_handle ( ) ,
332+ c:: FileAttributeTagInfo ,
333+ ptr:: addr_of_mut!( attr_tag) . cast ( ) ,
334+ mem:: size_of :: < c:: FILE_ATTRIBUTE_TAG_INFO > ( ) . try_into ( ) . unwrap ( ) ,
335+ ) ) ?;
336+ if attr_tag. FileAttributes & c:: FILE_ATTRIBUTE_REPARSE_POINT != 0 {
337+ reparse_tag = attr_tag. ReparseTag ;
333338 }
334339 }
335340 Ok ( FileAttr {
@@ -390,10 +395,15 @@ impl File {
390395 attr. file_size = info. AllocationSize as u64 ;
391396 attr. number_of_links = Some ( info. NumberOfLinks ) ;
392397 if attr. file_type ( ) . is_reparse_point ( ) {
393- let mut b =
394- Align8 ( [ MaybeUninit :: < u8 > :: uninit ( ) ; c:: MAXIMUM_REPARSE_DATA_BUFFER_SIZE ] ) ;
395- if let Ok ( ( _, buf) ) = self . reparse_point ( & mut b) {
396- attr. reparse_tag = ( * buf) . ReparseTag ;
398+ let mut attr_tag: c:: FILE_ATTRIBUTE_TAG_INFO = mem:: zeroed ( ) ;
399+ cvt ( c:: GetFileInformationByHandleEx (
400+ self . handle . as_raw_handle ( ) ,
401+ c:: FileAttributeTagInfo ,
402+ ptr:: addr_of_mut!( attr_tag) . cast ( ) ,
403+ mem:: size_of :: < c:: FILE_ATTRIBUTE_TAG_INFO > ( ) . try_into ( ) . unwrap ( ) ,
404+ ) ) ?;
405+ if attr_tag. FileAttributes & c:: FILE_ATTRIBUTE_REPARSE_POINT != 0 {
406+ reparse_tag = attr_tag. ReparseTag ;
397407 }
398408 }
399409 Ok ( attr)
0 commit comments