Skip to content

Commit

Permalink
GetConsoleScreenBufferInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 19, 2018
1 parent cae6520 commit f6eb90c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/fn_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,14 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
},

// Windows API stubs
"SetLastError" => {
let err = this.read_scalar(args[0])?.to_u32()?;
this.machine.last_error = err;
}
"GetLastError" => {
this.write_scalar(Scalar::from_uint(this.machine.last_error, Size::from_bits(32)), dest)?;
}

"AddVectoredExceptionHandler" => {
// any non zero value works for the stdlib. This is just used for stackoverflows anyway
this.write_scalar(Scalar::from_int(1, dest.layout.size), dest)?;
Expand All @@ -570,24 +578,16 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
"EnterCriticalSection" |
"LeaveCriticalSection" |
"DeleteCriticalSection" => {
this.machine.last_error = 120; // ERROR_CALL_NOT_IMPLEMENTED
// Nothing to do, not even a return value
},
"GetModuleHandleW" |
"GetProcAddress" |
"TryEnterCriticalSection" => {
this.machine.last_error = 120; // ERROR_CALL_NOT_IMPLEMENTED
"TryEnterCriticalSection" |
"GetConsoleScreenBufferInfo" => {
// pretend these do not exist/nothing happened, by returning zero
this.write_null(dest)?;
},

"SetLastError" => {
let err = this.read_scalar(args[0])?.to_u32()?;
this.machine.last_error = err;
}
"GetLastError" => {
this.write_scalar(Scalar::from_uint(this.machine.last_error, Size::from_bits(32)), dest)?;
}

"TlsAlloc" => {
// This just creates a key; Windows does not natively support TLS dtors.

Expand Down

0 comments on commit f6eb90c

Please sign in to comment.