authorgravatar for 77922942+expikr@users.noreply.github.comexpikr <77922942+expikr@users.noreply.github.com> 2023-11-03 19:16:35+08:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-11-21 14:10:25+02:00
log40bd93e2a24e3bdebd4f6454cfcffc51e5aaeeae
tree35c7fc2353b465b9882dc35ea4ef30f8017ecc80
parentc25f2fa561ecfed80e0cc2d0ffa9200ce30bb499

replace qpf and qpc

Update windows.zig Update windows.zig Update windows.zig Update windows.zig Update windows.zig Update windows.zig Update windows.zig Update ntdll.zig Update windows.zig Update ntdll.zig Update kernel32.zig

3 files changed, 9 insertions(+), 6 deletions(-)

lib/std/os/windows.zig+2-2
...@@ -1812,7 +1812,7 @@ pub fn QueryPerformanceFrequency() u64 {...@@ -1812,7 +1812,7 @@ pub fn QueryPerformanceFrequency() u64 {
1812 // "On systems that run Windows XP or later, the function will always succeed"1812 // "On systems that run Windows XP or later, the function will always succeed"
1813 // https://docs.microsoft.com/en-us/windows/desktop/api/profileapi/nf-profileapi-queryperformancefrequency1813 // https://docs.microsoft.com/en-us/windows/desktop/api/profileapi/nf-profileapi-queryperformancefrequency
1814 var result: LARGE_INTEGER = undefined;1814 var result: LARGE_INTEGER = undefined;
1815 assert(kernel32.QueryPerformanceFrequency(&result) != 0);1815 assert(ntdll.RtlQueryPerformanceFrequency(&result) != 0);
1816 // The kernel treats this integer as unsigned.1816 // The kernel treats this integer as unsigned.
1817 return @as(u64, @bitCast(result));1817 return @as(u64, @bitCast(result));
1818}1818}
...@@ -1821,7 +1821,7 @@ pub fn QueryPerformanceCounter() u64 {...@@ -1821,7 +1821,7 @@ pub fn QueryPerformanceCounter() u64 {
1821 // "On systems that run Windows XP or later, the function will always succeed"1821 // "On systems that run Windows XP or later, the function will always succeed"
1822 // https://docs.microsoft.com/en-us/windows/desktop/api/profileapi/nf-profileapi-queryperformancecounter1822 // https://docs.microsoft.com/en-us/windows/desktop/api/profileapi/nf-profileapi-queryperformancecounter
1823 var result: LARGE_INTEGER = undefined;1823 var result: LARGE_INTEGER = undefined;
1824 assert(kernel32.QueryPerformanceCounter(&result) != 0);1824 assert(ntdll.RtlQueryPerformanceCounter(&result) != 0);
1825 // The kernel treats this integer as unsigned.1825 // The kernel treats this integer as unsigned.
1826 return @as(u64, @bitCast(result));1826 return @as(u64, @bitCast(result));
1827}1827}
lib/std/os/windows/kernel32.zig-4
...@@ -276,10 +276,6 @@ pub extern "kernel32" fn MoveFileExW(...@@ -276,10 +276,6 @@ pub extern "kernel32" fn MoveFileExW(
276276
277pub extern "kernel32" fn PostQueuedCompletionStatus(CompletionPort: HANDLE, dwNumberOfBytesTransferred: DWORD, dwCompletionKey: ULONG_PTR, lpOverlapped: ?*OVERLAPPED) callconv(WINAPI) BOOL;277pub extern "kernel32" fn PostQueuedCompletionStatus(CompletionPort: HANDLE, dwNumberOfBytesTransferred: DWORD, dwCompletionKey: ULONG_PTR, lpOverlapped: ?*OVERLAPPED) callconv(WINAPI) BOOL;
278278
279pub extern "kernel32" fn QueryPerformanceCounter(lpPerformanceCount: *LARGE_INTEGER) callconv(WINAPI) BOOL;
280
281pub extern "kernel32" fn QueryPerformanceFrequency(lpFrequency: *LARGE_INTEGER) callconv(WINAPI) BOOL;
282
283pub extern "kernel32" fn ReadDirectoryChangesW(279pub extern "kernel32" fn ReadDirectoryChangesW(
284 hDirectory: HANDLE,280 hDirectory: HANDLE,
285 lpBuffer: [*]align(@alignOf(FILE_NOTIFY_INFORMATION)) u8,281 lpBuffer: [*]align(@alignOf(FILE_NOTIFY_INFORMATION)) u8,
lib/std/os/windows/ntdll.zig+7
...@@ -113,6 +113,13 @@ pub extern "ntdll" fn NtQueryAttributesFile(...@@ -113,6 +113,13 @@ pub extern "ntdll" fn NtQueryAttributesFile(
113 FileAttributes: *FILE_BASIC_INFORMATION,113 FileAttributes: *FILE_BASIC_INFORMATION,
114) callconv(WINAPI) NTSTATUS;114) callconv(WINAPI) NTSTATUS;
115115
116pub extern "ntdll" fn RtlQueryPerformanceCounter(PerformanceCounter: *LARGE_INTEGER) callconv(WINAPI) BOOL;
117pub extern "ntdll" fn RtlQueryPerformanceFrequency(PerformanceFrequency: *LARGE_INTEGER) callconv(WINAPI) BOOL;
118pub extern "ntdll" fn NtQueryPerformanceCounter(
119 PerformanceCounter: *LARGE_INTEGER,
120 PerformanceFrequency: ?*LARGE_INTEGER,
121) callconv(WINAPI) NTSTATUS;
122
116pub extern "ntdll" fn NtCreateFile(123pub extern "ntdll" fn NtCreateFile(
117 FileHandle: *HANDLE,124 FileHandle: *HANDLE,
118 DesiredAccess: ACCESS_MASK,125 DesiredAccess: ACCESS_MASK,