@@ -326,10 +326,15 @@ impl File {
326
326
cvt ( c:: GetFileInformationByHandle ( self . handle . as_raw_handle ( ) , & mut info) ) ?;
327
327
let mut reparse_tag = 0 ;
328
328
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 ;
333
338
}
334
339
}
335
340
Ok ( FileAttr {
@@ -390,10 +395,15 @@ impl File {
390
395
attr. file_size = info. AllocationSize as u64 ;
391
396
attr. number_of_links = Some ( info. NumberOfLinks ) ;
392
397
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 ;
397
407
}
398
408
}
399
409
Ok ( attr)
0 commit comments