File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -230,16 +230,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
230230 interp_ok ( match directories:: UserDirs :: new ( ) {
231231 Some ( dirs) => {
232232 let home = dirs. home_dir ( ) ;
233- let size_avail = if this. ptr_is_null ( size . ptr ( ) ) ? {
233+ let size_avail = if this. ptr_is_null ( buf ) ? {
234234 0 // if the buf pointer is null, we can't write to it; `size` will be updated to the required length
235235 } else {
236236 this. read_scalar ( & size) ?. to_u32 ( ) ?
237237 } ;
238238 // Of course we cannot use `windows_check_buffer_size` here since this uses
239239 // a different method for dealing with a too-small buffer than the other functions...
240240 let ( success, len) = this. write_path_to_wide_str ( home, buf, size_avail. into ( ) ) ?;
241- // The Windows docs just say that this is written on failure, but std relies on it
242- // always being written. Also see <https://github.com/rust-lang/rust/issues/141254> .
241+ // As per <https://github.com/MicrosoftDocs/sdk-api/pull/1810>, the size is always
242+ // written, not just on failure .
243243 this. write_scalar ( Scalar :: from_u32 ( len. try_into ( ) . unwrap ( ) ) , & size) ?;
244244 if success {
245245 Scalar :: from_i32 ( 1 ) // return TRUE
You can’t perform that action at this time.
0 commit comments