Skip to content

Commit 4f5fa90

Browse files
authored
Merge pull request #7195 from Aransentin/master
A win32-api proposal, implemented for user32.zig
2 parents 483c057 + c8723be commit 4f5fa90

File tree

3 files changed

+616
-103
lines changed

3 files changed

+616
-103
lines changed

lib/std/os/windows/bits.zig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub const UCHAR = u8;
3737
pub const FLOAT = f32;
3838
pub const HANDLE = *c_void;
3939
pub const HCRYPTPROV = ULONG_PTR;
40+
pub const ATOM = u16;
4041
pub const HBRUSH = *opaque {};
4142
pub const HCURSOR = *opaque {};
4243
pub const HICON = *opaque {};
@@ -770,13 +771,25 @@ pub const FILE_FLAG_SESSION_AWARE = 0x00800000;
770771
pub const FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000;
771772
pub const FILE_FLAG_WRITE_THROUGH = 0x80000000;
772773

774+
pub const RECT = extern struct {
775+
left: LONG,
776+
top: LONG,
777+
right: LONG,
778+
bottom: LONG,
779+
};
780+
773781
pub const SMALL_RECT = extern struct {
774782
Left: SHORT,
775783
Top: SHORT,
776784
Right: SHORT,
777785
Bottom: SHORT,
778786
};
779787

788+
pub const POINT = extern struct {
789+
x: LONG,
790+
y: LONG,
791+
};
792+
780793
pub const COORD = extern struct {
781794
X: SHORT,
782795
Y: SHORT,

lib/std/os/windows/kernel32.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub extern "kernel32" fn GetModuleFileNameW(hModule: ?HMODULE, lpFilename: [*]u1
115115
pub extern "kernel32" fn GetModuleHandleW(lpModuleName: ?[*:0]const WCHAR) callconv(WINAPI) ?HMODULE;
116116

117117
pub extern "kernel32" fn GetLastError() callconv(WINAPI) Win32Error;
118+
pub extern "kernel32" fn SetLastError(dwErrCode: Win32Error) callconv(WINAPI) void;
118119

119120
pub extern "kernel32" fn GetFileInformationByHandle(
120121
hFile: HANDLE,

0 commit comments

Comments
 (0)