Skip to content

Commit

Permalink
Replace some dynamic functions with static ones.
Browse files Browse the repository at this point in the history
PR [19271](ziglang#19271) added some static function implementations from kernel32, but some parts of the library still used the dynamically loaded versions.
  • Loading branch information
LucasSantos91 authored and SammyJames committed Aug 7, 2024
1 parent 0342b6d commit 83f7102
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/std/Thread.zig
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ const WindowsThreadImpl = struct {
pub const ThreadHandle = windows.HANDLE;

fn getCurrentId() windows.DWORD {
return windows.kernel32.GetCurrentThreadId();
return windows.GetCurrentThreadId();
}

fn getCpuCount() !usize {
Expand Down
4 changes: 2 additions & 2 deletions lib/std/debug.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ pub const WindowsModuleInfo = struct {
section_view: []const u8,

pub fn deinit(self: @This()) void {
const process_handle = windows.kernel32.GetCurrentProcess();
const process_handle = windows.GetCurrentProcess();
assert(windows.ntdll.NtUnmapViewOfSection(process_handle, @constCast(@ptrCast(self.section_view.ptr))) == .SUCCESS);
windows.CloseHandle(self.section_handle);
self.file.close();
Expand Down Expand Up @@ -1980,7 +1980,7 @@ pub const DebugInfo = struct {
// openFileAbsoluteW requires the prefix to be present
@memcpy(name_buffer[0..4], &[_]u16{ '\\', '?', '?', '\\' });

const process_handle = windows.kernel32.GetCurrentProcess();
const process_handle = windows.GetCurrentProcess();
const len = windows.kernel32.GetModuleFileNameExW(
process_handle,
module.handle,
Expand Down

0 comments on commit 83f7102

Please sign in to comment.