From fbf256716e499d9b2ee15c722c63d90d960f2859 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Fri, 6 Oct 2023 01:16:36 +0100 Subject: [PATCH] Miri: Add `CreateWaitableTimerEx` stub This function will always fail, allowing std's `Sleep` fallback path to be taken instead. --- src/tools/miri/src/shims/windows/foreign_items.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tools/miri/src/shims/windows/foreign_items.rs b/src/tools/miri/src/shims/windows/foreign_items.rs index d76d01b0789..24bb51ef5cb 100644 --- a/src/tools/miri/src/shims/windows/foreign_items.rs +++ b/src/tools/miri/src/shims/windows/foreign_items.rs @@ -267,6 +267,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { this.Sleep(timeout)?; } + "CreateWaitableTimerExW" => { + let [attributes, name, flags, access] = + this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?; + this.read_pointer(attributes)?; + this.read_pointer(name)?; + this.read_scalar(flags)?.to_u32()?; + this.read_scalar(access)?.to_u32()?; + // Unimplemented. Always return failure. + let not_supported = this.eval_windows("c", "ERROR_NOT_SUPPORTED"); + this.set_last_error(not_supported)?; + this.write_null(dest)?; + } // Synchronization primitives "AcquireSRWLockExclusive" => {