@@ -403,17 +403,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
403
403
n : & OpTy < ' tcx > , // ULONG
404
404
byte_offset : & OpTy < ' tcx > , // PLARGE_INTEGER
405
405
key : & OpTy < ' tcx > , // PULONG
406
- dest : & MPlaceTy < ' tcx > , // NTSTATUS
406
+ dest : & MPlaceTy < ' tcx > , // return type: NTSTATUS
407
407
) -> InterpResult < ' tcx , ( ) > {
408
- // ^ Returns NTSTATUS (u32 on Windows)
409
408
let this = self . eval_context_mut ( ) ;
410
409
let handle = this. read_handle ( handle, "NtWriteFile" ) ?;
411
410
let event = this. read_handle ( event, "NtWriteFile" ) ?;
412
411
let apc_routine = this. read_pointer ( apc_routine) ?;
413
412
let apc_ctx = this. read_pointer ( apc_ctx) ?;
414
413
let buf = this. read_pointer ( buf) ?;
415
414
let count = this. read_scalar ( n) ?. to_u32 ( ) ?;
416
- let byte_offset = this. read_target_usize ( byte_offset) ?; // is actually a pointer
415
+ let byte_offset = this. read_target_usize ( byte_offset) ?; // is actually a pointer, but we only support null
417
416
let key = this. read_pointer ( key) ?;
418
417
let io_status_block =
419
418
this. deref_pointer_as ( io_status_block, this. windows_ty_layout ( "IO_STATUS_BLOCK" ) ) ?;
@@ -426,13 +425,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
426
425
427
426
if !this. ptr_is_null ( apc_routine) ? {
428
427
throw_unsup_format ! (
429
- "`NtWriteFile` `ApcRoutine` parameter is not null, which is unsupported"
428
+ "`NtWriteFile` `ApcRoutine` parameter is non- null, which is unsupported"
430
429
) ;
431
430
}
432
431
433
432
if !this. ptr_is_null ( apc_ctx) ? {
434
433
throw_unsup_format ! (
435
- "`NtWriteFile` `ApcContext` parameter is not null, which is unsupported"
434
+ "`NtWriteFile` `ApcContext` parameter is non- null, which is unsupported"
436
435
) ;
437
436
}
438
437
@@ -443,7 +442,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
443
442
}
444
443
445
444
if !this. ptr_is_null ( key) ? {
446
- throw_unsup_format ! ( "`NtWriteFile` `Key` parameter is not null, which is unsupported" ) ;
445
+ throw_unsup_format ! ( "`NtWriteFile` `Key` parameter is non- null, which is unsupported" ) ;
447
446
}
448
447
449
448
let fd = match handle {
@@ -510,17 +509,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
510
509
n : & OpTy < ' tcx > , // ULONG
511
510
byte_offset : & OpTy < ' tcx > , // PLARGE_INTEGER
512
511
key : & OpTy < ' tcx > , // PULONG
513
- dest : & MPlaceTy < ' tcx > , // NTSTATUS
512
+ dest : & MPlaceTy < ' tcx > , // return type: NTSTATUS
514
513
) -> InterpResult < ' tcx , ( ) > {
515
- // ^ Returns NTSTATUS (u32 on Windows)
516
514
let this = self . eval_context_mut ( ) ;
517
515
let handle = this. read_handle ( handle, "NtReadFile" ) ?;
518
516
let event = this. read_handle ( event, "NtReadFile" ) ?;
519
517
let apc_routine = this. read_pointer ( apc_routine) ?;
520
518
let apc_ctx = this. read_pointer ( apc_ctx) ?;
521
519
let buf = this. read_pointer ( buf) ?;
522
520
let count = this. read_scalar ( n) ?. to_u32 ( ) ?;
523
- let byte_offset = this. read_target_usize ( byte_offset) ?; // is actually a pointer
521
+ let byte_offset = this. read_target_usize ( byte_offset) ?; // is actually a pointer, but we only support null
524
522
let key = this. read_pointer ( key) ?;
525
523
let io_status_block =
526
524
this. deref_pointer_as ( io_status_block, this. windows_ty_layout ( "IO_STATUS_BLOCK" ) ) ?;
@@ -531,13 +529,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
531
529
532
530
if !this. ptr_is_null ( apc_routine) ? {
533
531
throw_unsup_format ! (
534
- "`NtReadFile` `ApcRoutine` parameter is not null, which is unsupported"
532
+ "`NtReadFile` `ApcRoutine` parameter is non- null, which is unsupported"
535
533
) ;
536
534
}
537
535
538
536
if !this. ptr_is_null ( apc_ctx) ? {
539
537
throw_unsup_format ! (
540
- "`NtReadFile` `ApcContext` parameter is not null, which is unsupported"
538
+ "`NtReadFile` `ApcContext` parameter is non- null, which is unsupported"
541
539
) ;
542
540
}
543
541
@@ -548,7 +546,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
548
546
}
549
547
550
548
if !this. ptr_is_null ( key) ? {
551
- throw_unsup_format ! ( "`NtReadFile` `Key` parameter is not null, which is unsupported" ) ;
549
+ throw_unsup_format ! ( "`NtReadFile` `Key` parameter is non- null, which is unsupported" ) ;
552
550
}
553
551
554
552
// See NtWriteFile above for commentary on this
0 commit comments