| ... | @@ -11448,7 +11448,7 @@ fn clockResolution(userdata: ?*anyopaque, clock: Io.Clock) Io.Clock.ResolutionEr | ... | @@ -11448,7 +11448,7 @@ fn clockResolution(userdata: ?*anyopaque, clock: Io.Clock) Io.Clock.ResolutionEr |
| 11448 | // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-kuser_shared_data | 11448 | // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-kuser_shared_data |
| 11449 | // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm | 11449 | // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm |
| 11450 | var qpf: windows.LARGE_INTEGER = undefined; | 11450 | var qpf: windows.LARGE_INTEGER = undefined; |
| 11451 | if (windows.ntdll.RtlQueryPerformanceFrequency(&qpf).toBool()) { | 11451 | if (!windows.ntdll.RtlQueryPerformanceFrequency(&qpf).toBool()) { |
| 11452 | recoverableOsBugDetected(); | 11452 | recoverableOsBugDetected(); |
| 11453 | return .zero; | 11453 | return .zero; |
| 11454 | } | 11454 | } |
| ... | @@ -17677,7 +17677,8 @@ fn timeoutToWindowsInterval(timeout: Io.Timeout) ?windows.LARGE_INTEGER { | ... | @@ -17677,7 +17677,8 @@ fn timeoutToWindowsInterval(timeout: Io.Timeout) ?windows.LARGE_INTEGER { |
| 17677 | .duration => |d| nowWindows(clock).addDuration(d.raw), | 17677 | .duration => |d| nowWindows(clock).addDuration(d.raw), |
| 17678 | .deadline => |d| d.raw, | 17678 | .deadline => |d| d.raw, |
| 17679 | }; | 17679 | }; |
| 17680 | return @intCast(@max(@divTrunc(deadline.nanoseconds, 100), 0)); | 17680 | const epoch_ns = std.time.epoch.windows * std.time.ns_per_s; |
| | 17681 | return @intCast(@max(@divTrunc(deadline.nanoseconds - epoch_ns, 100), 0)); |
| 17681 | }, | 17682 | }, |
| 17682 | .awake, .boot => { | 17683 | .awake, .boot => { |
| 17683 | const duration = switch (timeout) { | 17684 | const duration = switch (timeout) { |