Skip to content

Commit fbf2567

Browse files
committed
Miri: Add CreateWaitableTimerEx stub
This function will always fail, allowing std's `Sleep` fallback path to be taken instead.
1 parent fca182b commit fbf2567

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tools/miri/src/shims/windows/foreign_items.rs

+12
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267267

268268
this.Sleep(timeout)?;
269269
}
270+
"CreateWaitableTimerExW" => {
271+
let [attributes, name, flags, access] =
272+
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
273+
this.read_pointer(attributes)?;
274+
this.read_pointer(name)?;
275+
this.read_scalar(flags)?.to_u32()?;
276+
this.read_scalar(access)?.to_u32()?;
277+
// Unimplemented. Always return failure.
278+
let not_supported = this.eval_windows("c", "ERROR_NOT_SUPPORTED");
279+
this.set_last_error(not_supported)?;
280+
this.write_null(dest)?;
281+
}
270282

271283
// Synchronization primitives
272284
"AcquireSRWLockExclusive" => {

0 commit comments

Comments
 (0)