@@ -343,16 +343,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
343
343
// FIXME: we should set last_error, but to what?
344
344
this. write_null ( dest) ?;
345
345
}
346
- "GetConsoleMode" => {
347
- // Windows "isatty" (in libtest) needs this, so we fake it.
348
- let [ console, mode] =
349
- this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
350
- this. read_scalar ( console) ?. to_machine_isize ( this) ?;
351
- this. deref_operand ( mode) ?;
352
- // Indicate an error.
353
- // FIXME: we should set last_error, but to what?
354
- this. write_null ( dest) ?;
355
- }
356
346
"GetStdHandle" => {
357
347
let [ which] =
358
348
this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
@@ -404,14 +394,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
404
394
let [ ] = this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
405
395
// Just fake a HANDLE
406
396
// It's fine to not use the Handle type here because its a stub
407
- this. write_scalar ( Scalar :: from_machine_isize ( 1 , this ) , dest) ?;
397
+ this. write_int ( 1 , dest) ?;
408
398
}
409
399
"GetModuleHandleA" if this. frame_in_std ( ) => {
410
400
#[ allow( non_snake_case) ]
411
401
let [ _lpModuleName] =
412
402
this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
413
403
// We need to return something non-null here to make `compat_fn!` work.
414
- this. write_scalar ( Scalar :: from_machine_isize ( 1 , this ) , dest) ?;
404
+ this. write_int ( 1 , dest) ?;
415
405
}
416
406
"SetConsoleTextAttribute" if this. frame_in_std ( ) => {
417
407
#[ allow( non_snake_case) ]
@@ -420,24 +410,39 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
420
410
// Pretend these does not exist / nothing happened, by returning zero.
421
411
this. write_null ( dest) ?;
422
412
}
413
+ "GetConsoleMode" if this. frame_in_std ( ) => {
414
+ let [ console, mode] =
415
+ this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
416
+ this. read_scalar ( console) ?. to_machine_isize ( this) ?;
417
+ this. deref_operand ( mode) ?;
418
+ // Indicate an error.
419
+ this. write_null ( dest) ?;
420
+ }
421
+ "GetFileInformationByHandleEx" if this. frame_in_std ( ) => {
422
+ #[ allow( non_snake_case) ]
423
+ let [ _hFile, _FileInformationClass, _lpFileInformation, _dwBufferSize] =
424
+ this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
425
+ // Just make it fail.
426
+ this. write_null ( dest) ?;
427
+ }
423
428
"AddVectoredExceptionHandler" if this. frame_in_std ( ) => {
424
429
#[ allow( non_snake_case) ]
425
430
let [ _First, _Handler] =
426
431
this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
427
432
// Any non zero value works for the stdlib. This is just used for stack overflows anyway.
428
- this. write_scalar ( Scalar :: from_machine_usize ( 1 , this ) , dest) ?;
433
+ this. write_int ( 1 , dest) ?;
429
434
}
430
435
"SetThreadStackGuarantee" if this. frame_in_std ( ) => {
431
436
#[ allow( non_snake_case) ]
432
437
let [ _StackSizeInBytes] =
433
438
this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
434
439
// Any non zero value works for the stdlib. This is just used for stack overflows anyway.
435
- this. write_scalar ( Scalar :: from_u32 ( 1 ) , dest) ?;
440
+ this. write_int ( 1 , dest) ?;
436
441
}
437
442
"GetCurrentProcessId" if this. frame_in_std ( ) => {
438
443
let [ ] = this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
439
444
let result = this. GetCurrentProcessId ( ) ?;
440
- this. write_scalar ( Scalar :: from_u32 ( result) , dest) ?;
445
+ this. write_int ( result, dest) ?;
441
446
}
442
447
// this is only callable from std because we know that std ignores the return value
443
448
"SwitchToThread" if this. frame_in_std ( ) => {
0 commit comments