Add shim for GetSystemTimePreciseAsFileTime
This is exactly the same as GetSystemTimeAsFileTime except that it promises maximum precision.
This commit is contained in:
parent
7e6dccc47d
commit
eb40adbd46
@ -110,12 +110,13 @@ fn gettimeofday(
|
|||||||
#[allow(non_snake_case, clippy::arithmetic_side_effects)]
|
#[allow(non_snake_case, clippy::arithmetic_side_effects)]
|
||||||
fn GetSystemTimeAsFileTime(
|
fn GetSystemTimeAsFileTime(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
shim_name: &str,
|
||||||
LPFILETIME_op: &OpTy<'tcx, Provenance>,
|
LPFILETIME_op: &OpTy<'tcx, Provenance>,
|
||||||
) -> InterpResult<'tcx> {
|
) -> InterpResult<'tcx> {
|
||||||
let this = self.eval_context_mut();
|
let this = self.eval_context_mut();
|
||||||
|
|
||||||
this.assert_target_os("windows", "GetSystemTimeAsFileTime");
|
this.assert_target_os("windows", shim_name);
|
||||||
this.check_no_isolation("`GetSystemTimeAsFileTime`")?;
|
this.check_no_isolation(shim_name)?;
|
||||||
|
|
||||||
let filetime = this.deref_pointer_as(LPFILETIME_op, this.windows_ty_layout("FILETIME"))?;
|
let filetime = this.deref_pointer_as(LPFILETIME_op, this.windows_ty_layout("FILETIME"))?;
|
||||||
|
|
||||||
|
@ -246,11 +246,11 @@ fn emulate_foreign_item_inner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Time related shims
|
// Time related shims
|
||||||
"GetSystemTimeAsFileTime" => {
|
"GetSystemTimeAsFileTime" | "GetSystemTimePreciseAsFileTime" => {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
let [LPFILETIME] =
|
let [LPFILETIME] =
|
||||||
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
|
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
|
||||||
this.GetSystemTimeAsFileTime(LPFILETIME)?;
|
this.GetSystemTimeAsFileTime(link_name.as_str(), LPFILETIME)?;
|
||||||
}
|
}
|
||||||
"QueryPerformanceCounter" => {
|
"QueryPerformanceCounter" => {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
Loading…
Reference in New Issue
Block a user