| author | |
| committer | |
| log | b05a5a3e52a0b14396d94c0d659edc980c1d79ce |
| tree | 7933c07abf1da9954006d4aa6d3ee121c0e0e508 |
| parent | 78c0d33eb75ed7985df39607cf0e0d2ae94ef98a |
| signature | Commit is signed but in an unrecognized format. |
3 files changed, 30 insertions(+), 0 deletions(-)
lib/std/os/windows.zig+16| ... | ... | @@ -97,6 +97,22 @@ pub fn CreatePipe(rd: *HANDLE, wr: *HANDLE, sattr: *const SECURITY_ATTRIBUTES) C |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | pub fn CreateEventEx(attributes: ?*SECURITY_ATTRIBUTES, name: []const u8, flags: DWORD, desired_access: DWORD) !HANDLE { | |
| 101 | const nameW = try sliceToPrefixedFileW(name); | |
| 102 | return CreateEventExW(attributes, &nameW, flags, desired_access); | |
| 103 | } | |
| 104 | ||
| 105 | pub fn CreateEventExW(attributes: ?*SECURITY_ATTRIBUTES, nameW: [*:0]const u16, flags: DWORD, desired_access: DWORD) !HANDLE { | |
| 106 | const handle = kernel32.CreateEventExW(attributes, nameW, flags, desired_access); | |
| 107 | if (handle) |h| { | |
| 108 | return h; | |
| 109 | } else { | |
| 110 | switch (kernel32.GetLastError()) { | |
| 111 | else => |err| return unexpectedError(err), | |
| 112 | } | |
| 113 | } | |
| 114 | } | |
| 115 | ||
| 100 | 116 | pub fn DeviceIoControl( |
| 101 | 117 | h: HANDLE, |
| 102 | 118 | ioControlCode: DWORD, |
lib/std/os/windows/bits.zig+7| ... | ... | @@ -489,6 +489,13 @@ pub const FILE_ATTRIBUTE_SYSTEM = 0x4; |
| 489 | 489 | pub const FILE_ATTRIBUTE_TEMPORARY = 0x100; |
| 490 | 490 | pub const FILE_ATTRIBUTE_VIRTUAL = 0x10000; |
| 491 | 491 | |
| 492 | // flags for CreateEvent | |
| 493 | pub const CREATE_EVENT_INITIAL_SET = 0x00000002; | |
| 494 | pub const CREATE_EVENT_MANUAL_RESET = 0x00000001; | |
| 495 | ||
| 496 | pub const EVENT_ALL_ACCESS = 0x1F0003; | |
| 497 | pub const EVENT_MODIFY_STATE = 0x0002; | |
| 498 | ||
| 492 | 499 | pub const PROCESS_INFORMATION = extern struct { |
| 493 | 500 | hProcess: HANDLE, |
| 494 | 501 | hThread: HANDLE, |
lib/std/os/windows/kernel32.zig+7| ... | ... | @@ -9,6 +9,13 @@ pub extern "kernel32" stdcallcc fn CloseHandle(hObject: HANDLE) BOOL; |
| 9 | 9 | |
| 10 | 10 | pub extern "kernel32" stdcallcc fn CreateDirectoryW(lpPathName: [*]const u16, lpSecurityAttributes: ?*SECURITY_ATTRIBUTES) BOOL; |
| 11 | 11 | |
| 12 | pub extern "kernel32" stdcallcc fn CreateEventExW( | |
| 13 | lpEventAttributes: ?*SECURITY_ATTRIBUTES, | |
| 14 | lpName: [*:0]const u16, | |
| 15 | dwFlags: DWORD, | |
| 16 | dwDesiredAccess: DWORD, | |
| 17 | ) ?HANDLE; | |
| 18 | ||
| 12 | 19 | pub extern "kernel32" stdcallcc fn CreateFileW( |
| 13 | 20 | lpFileName: [*]const u16, // TODO null terminated pointer type |
| 14 | 21 | dwDesiredAccess: DWORD, |