Skip to content

Commit 3f632d9

Browse files
committed
shim more Windows functions
1 parent 52ec21e commit 3f632d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/fn_call.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,14 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
739739
// any non zero value works for the stdlib. This is just used for stackoverflows anyway
740740
self.write_scalar(dest, Scalar::from_u128(1), usize)?;
741741
},
742+
"std::sys::windows::c::::GetModuleHandleW" |
743+
"std::sys::windows::c::::GetProcAddress" |
744+
"std::sys::windows::c::::SetLastError" |
745+
"std::sys::windows::c::::GetLastError" => {
746+
let usize = self.tcx.types.usize;
747+
// pretend these do not exist/nothing happened, by returning zero
748+
self.write_scalar(dest, Scalar::from_u128(0), usize)?;
749+
},
742750
_ => return err!(NoMirFor(path)),
743751
}
744752

0 commit comments

Comments
 (0)