about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2023-10-06 01:16:36 +0100
committerChris Denton <chris@chrisdenton.dev>2023-10-06 13:10:28 +0100
commitfbf256716e499d9b2ee15c722c63d90d960f2859 (patch)
treedbb8d23c927d73950237011100e0bb30c113d3e6
parentfca182b6a0c43f3240d6c76397cad1c143e3774c (diff)
Miri: Add `CreateWaitableTimerEx` stub
This function will always fail, allowing std's `Sleep` fallback path to be taken instead.
-rw-r--r--src/tools/miri/src/shims/windows/foreign_items.rs12
1 files changed, 12 insertions, 0 deletions
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" => {