4 use helpers::check_arg_count;
6 #[derive(Debug, Copy, Clone)]
8 AcquireSRWLockExclusive,
13 // Returns an error for unsupported symbols, and None if this symbol
14 // should become a NULL pointer (pretend it does not exist).
15 pub fn from_str(name: &str) -> InterpResult<'static, Option<Dlsym>> {
17 "AcquireSRWLockExclusive" => Some(Dlsym::AcquireSRWLockExclusive),
18 "AcquireSRWLockShared" => Some(Dlsym::AcquireSRWLockShared),
19 "SetThreadStackGuarantee" => None,
20 "GetSystemTimePreciseAsFileTime" => None,
21 _ => throw_unsup_format!("unsupported Windows dlsym: {}", name),
26 impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
27 pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
31 args: &[OpTy<'tcx, Tag>],
32 ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
33 ) -> InterpResult<'tcx> {
34 let this = self.eval_context_mut();
35 let (dest, ret) = ret.expect("we don't support any diverging dlsym");
36 assert!(this.tcx.sess.target.target.target_os == "windows");
39 Dlsym::AcquireSRWLockExclusive => {
40 let &[ptr] = check_arg_count(args)?;
41 let lock = this.deref_operand(ptr)?; // points to ptr-sized data
42 throw_unsup_format!("AcquireSRWLockExclusive is not actually implemented");
44 Dlsym::AcquireSRWLockShared => {
45 let &[ptr] = check_arg_count(args)?;
46 let lock = this.deref_operand(ptr)?; // points to ptr-sized data
47 throw_unsup_format!("AcquireSRWLockExclusive is not actually implemented");
51 this.dump_place(*dest);
52 this.go_to_block(ret);