authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-08-25 17:39:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-01 17:54:06-07:00
log7884d84315f4080bfe429d3e29f7ebedf9f3f623
tree47bcd14b92deec25c91b6033a485f7a375db99bb
parentb781ef464d6ed01ecff9cfef94b09805a18fae6c

std.os.windows: reorg to avoid `usingnamespace`

Down to 19 uses of `usingnamespace`.

23 files changed, 1877 insertions(+), 2982 deletions(-)

lib/std/array_list.zig+15-13
......@@ -236,21 +236,23 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
236236 mem.copy(T, self.items[old_len..], items);
237237 }
238238
239 pub usingnamespace if (T != u8) struct {} else struct {
240 pub const Writer = std.io.Writer(*Self, error{OutOfMemory}, appendWrite);
239 pub const Writer = if (T != u8)
240 @compileError("The Writer interface is only defined for ArrayList(u8) " ++
241 "but the given type is ArrayList(" ++ @typeName(T) ++ ")")
242 else
243 std.io.Writer(*Self, error{OutOfMemory}, appendWrite);
241244
242 /// Initializes a Writer which will append to the list.
243 pub fn writer(self: *Self) Writer {
244 return .{ .context = self };
245 }
245 /// Initializes a Writer which will append to the list.
246 pub fn writer(self: *Self) Writer {
247 return .{ .context = self };
248 }
246249
247 /// Same as `append` except it returns the number of bytes written, which is always the same
248 /// as `m.len`. The purpose of this function existing is to match `std.io.Writer` API.
249 fn appendWrite(self: *Self, m: []const u8) !usize {
250 try self.appendSlice(m);
251 return m.len;
252 }
253 };
250 /// Same as `append` except it returns the number of bytes written, which is always the same
251 /// as `m.len`. The purpose of this function existing is to match `std.io.Writer` API.
252 fn appendWrite(self: *Self, m: []const u8) !usize {
253 try self.appendSlice(m);
254 return m.len;
255 }
254256
255257 /// Append a value to the list `n` times.
256258 /// Allocates more memory as necessary.
lib/std/c/freebsd.zig+3-1
......@@ -969,7 +969,7 @@ pub const sigset_t = extern struct {
969969
970970pub const empty_sigset = sigset_t{ .__bits = [_]u32{0} ** _SIG_WORDS };
971971
972pub usingnamespace switch (builtin.cpu.arch) {
972const arch_bits = switch (builtin.cpu.arch) {
973973 .x86_64 => struct {
974974 pub const ucontext_t = extern struct {
975975 sigmask: sigset_t,
......@@ -1015,6 +1015,8 @@ pub usingnamespace switch (builtin.cpu.arch) {
10151015 },
10161016 else => struct {},
10171017};
1018pub const ucontext_t = arch_bits.ucontext_t;
1019pub const mcontext_t = arch_bits.mcontext_t;
10181020
10191021pub const E = enum(u16) {
10201022 /// No error occurred.
lib/std/c/haiku.zig-2
......@@ -1,8 +1,6 @@
11const std = @import("../std.zig");
22const maxInt = std.math.maxInt;
33
4usingnamespace std.c;
5
64extern "c" fn _errnop() *c_int;
75
86pub const _errno = _errnop;
lib/std/c/netbsd.zig-2
......@@ -2,8 +2,6 @@ const std = @import("../std.zig");
22const builtin = @import("builtin");
33const maxInt = std.math.maxInt;
44
5usingnamespace std.c;
6
75extern "c" fn __errno() *c_int;
86pub const _errno = __errno;
97
lib/std/c/openbsd.zig+3-1
......@@ -810,7 +810,7 @@ comptime {
810810 std.debug.assert(@sizeOf(siginfo_t) == 136);
811811}
812812
813pub usingnamespace switch (builtin.cpu.arch) {
813const arch_bits = switch (builtin.cpu.arch) {
814814 .x86_64 => struct {
815815 pub const ucontext_t = extern struct {
816816 sc_rdi: c_long,
......@@ -863,6 +863,8 @@ pub usingnamespace switch (builtin.cpu.arch) {
863863 },
864864 else => struct {},
865865};
866pub const ucontext_t = arch_bits.ucontext_t;
867pub const fxsave64 = arch_bits.fxsave64;
866868
867869pub const sigset_t = c_uint;
868870pub const empty_sigset: sigset_t = 0;
lib/std/c/windows.zig+36-30
......@@ -1,6 +1,8 @@
11//! The reference for these types and values is Microsoft Windows's ucrt (Universal C RunTime).
2const std = @import("../std.zig");
3const ws2_32 = std.os.windows.ws2_32;
24
3const ws2_32 = @import("../os/windows/ws2_32.zig");
5const windows = std.os.windows;
46
57pub extern "c" fn _errno() *c_int;
68
......@@ -22,9 +24,9 @@ pub extern "c" fn sigfillset(set: ?*sigset_t) void;
2224pub extern "c" fn alarm(seconds: c_uint) c_uint;
2325pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;
2426
25pub const fd_t = HANDLE;
26pub const ino_t = LARGE_INTEGER;
27pub const pid_t = HANDLE;
27pub const fd_t = windows.HANDLE;
28pub const ino_t = windows.LARGE_INTEGER;
29pub const pid_t = windows.HANDLE;
2830pub const mode_t = u0;
2931
3032pub const PATH_MAX = 260;
......@@ -191,7 +193,9 @@ pub const STRUNCATE = 80;
191193pub const F_OK = 0;
192194
193195/// Remove directory instead of unlinking file
194pub const AT_REMOVEDIR = 0x200;
196pub const AT = struct {
197 pub const REMOVEDIR = 0x200;
198};
195199
196200pub const in_port_t = u16;
197201pub const sa_family_t = ws2_32.ADDRESS_FAMILY;
......@@ -205,7 +209,7 @@ pub const in_addr = u32;
205209pub const addrinfo = ws2_32.addrinfo;
206210pub const AF = ws2_32.AF;
207211pub const SOCK = ws2_32.SOCK;
208pub const IPPROTO = ws2_32.IPPROTOP;
212pub const IPPROTO = ws2_32.IPPROTO;
209213pub const BTHPROTO_RFCOMM = ws2_32.BTHPROTO_RFCOMM;
210214
211215pub const nfds_t = c_ulong;
......@@ -216,29 +220,31 @@ pub const SO = ws2_32.SO;
216220pub const PVD_CONFIG = ws2_32.PVD_CONFIG;
217221pub const TCP_NODELAY = ws2_32.TCP_NODELAY;
218222
219pub const O_RDONLY = 0o0;
220pub const O_WRONLY = 0o1;
221pub const O_RDWR = 0o2;
222
223pub const O_CREAT = 0o100;
224pub const O_EXCL = 0o200;
225pub const O_NOCTTY = 0o400;
226pub const O_TRUNC = 0o1000;
227pub const O_APPEND = 0o2000;
228pub const O_NONBLOCK = 0o4000;
229pub const O_DSYNC = 0o10000;
230pub const O_SYNC = 0o4010000;
231pub const O_RSYNC = 0o4010000;
232pub const O_DIRECTORY = 0o200000;
233pub const O_NOFOLLOW = 0o400000;
234pub const O_CLOEXEC = 0o2000000;
235
236pub const O_ASYNC = 0o20000;
237pub const O_DIRECT = 0o40000;
238pub const O_LARGEFILE = 0;
239pub const O_NOATIME = 0o1000000;
240pub const O_PATH = 0o10000000;
241pub const O_TMPFILE = 0o20200000;
242pub const O_NDELAY = O_NONBLOCK;
223pub const O = struct {
224 pub const RDONLY = 0o0;
225 pub const WRONLY = 0o1;
226 pub const RDWR = 0o2;
227
228 pub const CREAT = 0o100;
229 pub const EXCL = 0o200;
230 pub const NOCTTY = 0o400;
231 pub const TRUNC = 0o1000;
232 pub const APPEND = 0o2000;
233 pub const NONBLOCK = 0o4000;
234 pub const DSYNC = 0o10000;
235 pub const SYNC = 0o4010000;
236 pub const RSYNC = 0o4010000;
237 pub const DIRECTORY = 0o200000;
238 pub const NOFOLLOW = 0o400000;
239 pub const CLOEXEC = 0o2000000;
240
241 pub const ASYNC = 0o20000;
242 pub const DIRECT = 0o40000;
243 pub const LARGEFILE = 0;
244 pub const NOATIME = 0o1000000;
245 pub const PATH = 0o10000000;
246 pub const TMPFILE = 0o20200000;
247 pub const NDELAY = NONBLOCK;
248};
243249
244250pub const IFNAMESIZE = 30;
lib/std/fs/file.zig+12-9
......@@ -12,20 +12,23 @@ const is_windows = std.Target.current.os.tag == .windows;
1212
1313pub const File = struct {
1414 /// The OS-specific file descriptor or file handle.
15 handle: os.fd_t,
15 handle: Handle,
1616
17 /// On some systems, such as Linux, file system file descriptors are incapable of non-blocking I/O.
18 /// This forces us to perform asynchronous I/O on a dedicated thread, to achieve non-blocking
19 /// file-system I/O. To do this, `File` must be aware of whether it is a file system file descriptor,
20 /// or, more specifically, whether the I/O is always blocking.
17 /// On some systems, such as Linux, file system file descriptors are incapable
18 /// of non-blocking I/O. This forces us to perform asynchronous I/O on a dedicated thread,
19 /// to achieve non-blocking file-system I/O. To do this, `File` must be aware of whether
20 /// it is a file system file descriptor, or, more specifically, whether the I/O is always
21 /// blocking.
2122 capable_io_mode: io.ModeOverride = io.default_mode,
2223
23 /// Furthermore, even when `std.io.mode` is async, it is still sometimes desirable to perform blocking I/O,
24 /// although not by default. For example, when printing a stack trace to stderr.
25 /// This field tracks both by acting as an overriding I/O mode. When not building in async I/O mode,
26 /// the type only has the `.blocking` tag, making it a zero-bit type.
24 /// Furthermore, even when `std.io.mode` is async, it is still sometimes desirable
25 /// to perform blocking I/O, although not by default. For example, when printing a
26 /// stack trace to stderr. This field tracks both by acting as an overriding I/O mode.
27 /// When not building in async I/O mode, the type only has the `.blocking` tag, making
28 /// it a zero-bit type.
2729 intended_io_mode: io.ModeOverride = io.default_mode,
2830
31 pub const Handle = os.fd_t;
2932 pub const Mode = os.mode_t;
3033 pub const INode = os.ino_t;
3134
lib/std/fs/wasi.zig+1-2
......@@ -3,8 +3,7 @@ const os = std.os;
33const mem = std.mem;
44const math = std.math;
55const Allocator = mem.Allocator;
6
7usingnamespace std.os.wasi;
6const wasi = std.os.wasi;
87
98/// Type-tag of WASI preopen.
109///
lib/std/os.zig+5-5
......@@ -23,6 +23,7 @@ const mem = std.mem;
2323const elf = std.elf;
2424const dl = @import("dynamic_library.zig");
2525const MAX_PATH_BYTES = std.fs.MAX_PATH_BYTES;
26const is_windows = builtin.os.tag == .windows;
2627
2728pub const darwin = std.c;
2829pub const dragonfly = std.c;
......@@ -53,12 +54,11 @@ test {
5354/// When not linking libc, it is the OS-specific system interface.
5455pub const system = if (@hasDecl(root, "os") and root.os != @This())
5556 root.os.system
56else if (builtin.link_libc)
57else if (builtin.link_libc or is_windows)
5758 std.c
5859else switch (builtin.os.tag) {
5960 .linux => linux,
6061 .wasi => wasi,
61 .windows => windows,
6262 .uefi => uefi,
6363 else => struct {},
6464};
......@@ -1949,7 +1949,7 @@ pub fn unlinkW(file_path_w: []const u16) UnlinkError!void {
19491949}
19501950
19511951pub const UnlinkatError = UnlinkError || error{
1952 /// When passing `AT_REMOVEDIR`, this error occurs when the named directory is not empty.
1952 /// When passing `AT.REMOVEDIR`, this error occurs when the named directory is not empty.
19531953 DirNotEmpty,
19541954};
19551955
......@@ -1972,7 +1972,7 @@ pub const unlinkatC = @compileError("deprecated: renamed to unlinkatZ");
19721972/// WASI-only. Same as `unlinkat` but targeting WASI.
19731973/// See also `unlinkat`.
19741974pub fn unlinkatWasi(dirfd: fd_t, file_path: []const u8, flags: u32) UnlinkatError!void {
1975 const remove_dir = (flags & AT_REMOVEDIR) != 0;
1975 const remove_dir = (flags & AT.REMOVEDIR) != 0;
19761976 const res = if (remove_dir)
19771977 wasi.path_remove_directory(dirfd, file_path.ptr, file_path.len)
19781978 else
......@@ -2032,7 +2032,7 @@ pub fn unlinkatZ(dirfd: fd_t, file_path_c: [*:0]const u8, flags: u32) UnlinkatEr
20322032
20332033/// Same as `unlinkat` but `sub_path_w` is UTF16LE, NT prefixed. Windows only.
20342034pub fn unlinkatW(dirfd: fd_t, sub_path_w: []const u16, flags: u32) UnlinkatError!void {
2035 const remove_dir = (flags & AT_REMOVEDIR) != 0;
2035 const remove_dir = (flags & AT.REMOVEDIR) != 0;
20362036 return windows.DeleteFile(sub_path_w, .{ .dir = dirfd, .remove_dir = remove_dir });
20372037}
20382038
lib/std/os/test.zig+1-1
......@@ -676,7 +676,7 @@ test "fsync" {
676676}
677677
678678test "getrlimit and setrlimit" {
679 if (!@hasDecl(os, "rlimit")) {
679 if (native_os == .windows) {
680680 return error.SkipZigTest;
681681 }
682682
lib/std/os/windows.zig+1649-14
......@@ -1,8 +1,8 @@
1// This file contains thin wrappers around Windows-specific APIs, with these
2// specific goals in mind:
3// * Convert "errno"-style error codes into Zig errors.
4// * When null-terminated or UTF16LE byte buffers are required, provide APIs which accept
5// slices as well as APIs which accept null-terminated UTF16LE byte buffers.
1//! This file contains thin wrappers around Windows-specific APIs, with these
2//! specific goals in mind:
3//! * Convert "errno"-style error codes into Zig errors.
4//! * When null-terminated or UTF16LE byte buffers are required, provide APIs which accept
5//! slices as well as APIs which accept null-terminated UTF16LE byte buffers.
66
77const builtin = @import("builtin");
88const std = @import("../std.zig");
......@@ -10,6 +10,13 @@ const mem = std.mem;
1010const assert = std.debug.assert;
1111const math = std.math;
1212const maxInt = std.math.maxInt;
13const native_arch = builtin.cpu.arch;
14
15test {
16 if (builtin.os.tag == .windows) {
17 _ = @import("windows/test.zig");
18 }
19}
1320
1421pub const advapi32 = @import("windows/advapi32.zig");
1522pub const kernel32 = @import("windows/kernel32.zig");
......@@ -22,8 +29,6 @@ pub const ws2_32 = @import("windows/ws2_32.zig");
2229pub const gdi32 = @import("windows/gdi32.zig");
2330pub const winmm = @import("windows/winmm.zig");
2431
25pub usingnamespace @import("windows/bits.zig");
26
2732pub const self_process_handle = @intToPtr(HANDLE, maxInt(usize));
2833
2934pub const OpenError = error{
......@@ -1017,7 +1022,7 @@ pub fn QueryObjectName(
10171022 }
10181023}
10191024test "QueryObjectName" {
1020 if (comptime builtin.target.os.tag != .windows)
1025 if (builtin.os.tag != .windows)
10211026 return;
10221027
10231028 //any file will do; canonicalization works on NTFS junctions and symlinks, hardlinks remain separate paths.
......@@ -1171,7 +1176,7 @@ pub fn GetFinalPathNameByHandle(
11711176}
11721177
11731178test "GetFinalPathNameByHandle" {
1174 if (comptime builtin.target.os.tag != .windows)
1179 if (builtin.os.tag != .windows)
11751180 return;
11761181
11771182 //any file will do
......@@ -1720,7 +1725,7 @@ pub fn UnlockFile(
17201725}
17211726
17221727pub fn teb() *TEB {
1723 return switch (builtin.target.cpu.arch) {
1728 return switch (native_arch) {
17241729 .i386 => asm volatile (
17251730 \\ movl %%fs:0x18, %[ptr]
17261731 : [ptr] "=r" (-> *TEB),
......@@ -2025,8 +2030,1638 @@ pub fn GetThreadDescription(hThread: HANDLE, ppszThreadDescription: *LPWSTR) !vo
20252030 }
20262031}
20272032
2028test "" {
2029 if (builtin.os.tag == .windows) {
2030 _ = @import("windows/test.zig");
2031 }
2033pub const Win32Error = @import("windows/win32error.zig").Win32Error;
2034pub const NTSTATUS = @import("windows/ntstatus.zig").NTSTATUS;
2035pub const LANG = @import("windows/lang.zig");
2036pub const SUBLANG = @import("windows/sublang.zig");
2037
2038/// The standard input device. Initially, this is the console input buffer, CONIN$.
2039pub const STD_INPUT_HANDLE = maxInt(DWORD) - 10 + 1;
2040
2041/// The standard output device. Initially, this is the active console screen buffer, CONOUT$.
2042pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;
2043
2044/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.
2045pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;
2046
2047pub const WINAPI: std.builtin.CallingConvention = if (native_arch == .i386)
2048 .Stdcall
2049else
2050 .C;
2051
2052pub const BOOL = c_int;
2053pub const BOOLEAN = BYTE;
2054pub const BYTE = u8;
2055pub const CHAR = u8;
2056pub const UCHAR = u8;
2057pub const FLOAT = f32;
2058pub const HANDLE = *c_void;
2059pub const HCRYPTPROV = ULONG_PTR;
2060pub const ATOM = u16;
2061pub const HBRUSH = *opaque {};
2062pub const HCURSOR = *opaque {};
2063pub const HICON = *opaque {};
2064pub const HINSTANCE = *opaque {};
2065pub const HMENU = *opaque {};
2066pub const HMODULE = *opaque {};
2067pub const HWND = *opaque {};
2068pub const HDC = *opaque {};
2069pub const HGLRC = *opaque {};
2070pub const FARPROC = *opaque {};
2071pub const INT = c_int;
2072pub const LPCSTR = [*:0]const CHAR;
2073pub const LPCVOID = *const c_void;
2074pub const LPSTR = [*:0]CHAR;
2075pub const LPVOID = *c_void;
2076pub const LPWSTR = [*:0]WCHAR;
2077pub const LPCWSTR = [*:0]const WCHAR;
2078pub const PVOID = *c_void;
2079pub const PWSTR = [*:0]WCHAR;
2080pub const SIZE_T = usize;
2081pub const UINT = c_uint;
2082pub const ULONG_PTR = usize;
2083pub const LONG_PTR = isize;
2084pub const DWORD_PTR = ULONG_PTR;
2085pub const WCHAR = u16;
2086pub const WORD = u16;
2087pub const DWORD = u32;
2088pub const DWORD64 = u64;
2089pub const LARGE_INTEGER = i64;
2090pub const ULARGE_INTEGER = u64;
2091pub const USHORT = u16;
2092pub const SHORT = i16;
2093pub const ULONG = u32;
2094pub const LONG = i32;
2095pub const ULONGLONG = u64;
2096pub const LONGLONG = i64;
2097pub const HLOCAL = HANDLE;
2098pub const LANGID = c_ushort;
2099
2100pub const WPARAM = usize;
2101pub const LPARAM = LONG_PTR;
2102pub const LRESULT = LONG_PTR;
2103
2104pub const va_list = *opaque {};
2105
2106pub const TRUE = 1;
2107pub const FALSE = 0;
2108
2109pub const DEVICE_TYPE = ULONG;
2110pub const FILE_DEVICE_BEEP: DEVICE_TYPE = 0x0001;
2111pub const FILE_DEVICE_CD_ROM: DEVICE_TYPE = 0x0002;
2112pub const FILE_DEVICE_CD_ROM_FILE_SYSTEM: DEVICE_TYPE = 0x0003;
2113pub const FILE_DEVICE_CONTROLLER: DEVICE_TYPE = 0x0004;
2114pub const FILE_DEVICE_DATALINK: DEVICE_TYPE = 0x0005;
2115pub const FILE_DEVICE_DFS: DEVICE_TYPE = 0x0006;
2116pub const FILE_DEVICE_DISK: DEVICE_TYPE = 0x0007;
2117pub const FILE_DEVICE_DISK_FILE_SYSTEM: DEVICE_TYPE = 0x0008;
2118pub const FILE_DEVICE_FILE_SYSTEM: DEVICE_TYPE = 0x0009;
2119pub const FILE_DEVICE_INPORT_PORT: DEVICE_TYPE = 0x000a;
2120pub const FILE_DEVICE_KEYBOARD: DEVICE_TYPE = 0x000b;
2121pub const FILE_DEVICE_MAILSLOT: DEVICE_TYPE = 0x000c;
2122pub const FILE_DEVICE_MIDI_IN: DEVICE_TYPE = 0x000d;
2123pub const FILE_DEVICE_MIDI_OUT: DEVICE_TYPE = 0x000e;
2124pub const FILE_DEVICE_MOUSE: DEVICE_TYPE = 0x000f;
2125pub const FILE_DEVICE_MULTI_UNC_PROVIDER: DEVICE_TYPE = 0x0010;
2126pub const FILE_DEVICE_NAMED_PIPE: DEVICE_TYPE = 0x0011;
2127pub const FILE_DEVICE_NETWORK: DEVICE_TYPE = 0x0012;
2128pub const FILE_DEVICE_NETWORK_BROWSER: DEVICE_TYPE = 0x0013;
2129pub const FILE_DEVICE_NETWORK_FILE_SYSTEM: DEVICE_TYPE = 0x0014;
2130pub const FILE_DEVICE_NULL: DEVICE_TYPE = 0x0015;
2131pub const FILE_DEVICE_PARALLEL_PORT: DEVICE_TYPE = 0x0016;
2132pub const FILE_DEVICE_PHYSICAL_NETCARD: DEVICE_TYPE = 0x0017;
2133pub const FILE_DEVICE_PRINTER: DEVICE_TYPE = 0x0018;
2134pub const FILE_DEVICE_SCANNER: DEVICE_TYPE = 0x0019;
2135pub const FILE_DEVICE_SERIAL_MOUSE_PORT: DEVICE_TYPE = 0x001a;
2136pub const FILE_DEVICE_SERIAL_PORT: DEVICE_TYPE = 0x001b;
2137pub const FILE_DEVICE_SCREEN: DEVICE_TYPE = 0x001c;
2138pub const FILE_DEVICE_SOUND: DEVICE_TYPE = 0x001d;
2139pub const FILE_DEVICE_STREAMS: DEVICE_TYPE = 0x001e;
2140pub const FILE_DEVICE_TAPE: DEVICE_TYPE = 0x001f;
2141pub const FILE_DEVICE_TAPE_FILE_SYSTEM: DEVICE_TYPE = 0x0020;
2142pub const FILE_DEVICE_TRANSPORT: DEVICE_TYPE = 0x0021;
2143pub const FILE_DEVICE_UNKNOWN: DEVICE_TYPE = 0x0022;
2144pub const FILE_DEVICE_VIDEO: DEVICE_TYPE = 0x0023;
2145pub const FILE_DEVICE_VIRTUAL_DISK: DEVICE_TYPE = 0x0024;
2146pub const FILE_DEVICE_WAVE_IN: DEVICE_TYPE = 0x0025;
2147pub const FILE_DEVICE_WAVE_OUT: DEVICE_TYPE = 0x0026;
2148pub const FILE_DEVICE_8042_PORT: DEVICE_TYPE = 0x0027;
2149pub const FILE_DEVICE_NETWORK_REDIRECTOR: DEVICE_TYPE = 0x0028;
2150pub const FILE_DEVICE_BATTERY: DEVICE_TYPE = 0x0029;
2151pub const FILE_DEVICE_BUS_EXTENDER: DEVICE_TYPE = 0x002a;
2152pub const FILE_DEVICE_MODEM: DEVICE_TYPE = 0x002b;
2153pub const FILE_DEVICE_VDM: DEVICE_TYPE = 0x002c;
2154pub const FILE_DEVICE_MASS_STORAGE: DEVICE_TYPE = 0x002d;
2155pub const FILE_DEVICE_SMB: DEVICE_TYPE = 0x002e;
2156pub const FILE_DEVICE_KS: DEVICE_TYPE = 0x002f;
2157pub const FILE_DEVICE_CHANGER: DEVICE_TYPE = 0x0030;
2158pub const FILE_DEVICE_SMARTCARD: DEVICE_TYPE = 0x0031;
2159pub const FILE_DEVICE_ACPI: DEVICE_TYPE = 0x0032;
2160pub const FILE_DEVICE_DVD: DEVICE_TYPE = 0x0033;
2161pub const FILE_DEVICE_FULLSCREEN_VIDEO: DEVICE_TYPE = 0x0034;
2162pub const FILE_DEVICE_DFS_FILE_SYSTEM: DEVICE_TYPE = 0x0035;
2163pub const FILE_DEVICE_DFS_VOLUME: DEVICE_TYPE = 0x0036;
2164pub const FILE_DEVICE_SERENUM: DEVICE_TYPE = 0x0037;
2165pub const FILE_DEVICE_TERMSRV: DEVICE_TYPE = 0x0038;
2166pub const FILE_DEVICE_KSEC: DEVICE_TYPE = 0x0039;
2167pub const FILE_DEVICE_FIPS: DEVICE_TYPE = 0x003a;
2168pub const FILE_DEVICE_INFINIBAND: DEVICE_TYPE = 0x003b;
2169// TODO: missing values?
2170pub const FILE_DEVICE_VMBUS: DEVICE_TYPE = 0x003e;
2171pub const FILE_DEVICE_CRYPT_PROVIDER: DEVICE_TYPE = 0x003f;
2172pub const FILE_DEVICE_WPD: DEVICE_TYPE = 0x0040;
2173pub const FILE_DEVICE_BLUETOOTH: DEVICE_TYPE = 0x0041;
2174pub const FILE_DEVICE_MT_COMPOSITE: DEVICE_TYPE = 0x0042;
2175pub const FILE_DEVICE_MT_TRANSPORT: DEVICE_TYPE = 0x0043;
2176pub const FILE_DEVICE_BIOMETRIC: DEVICE_TYPE = 0x0044;
2177pub const FILE_DEVICE_PMI: DEVICE_TYPE = 0x0045;
2178pub const FILE_DEVICE_EHSTOR: DEVICE_TYPE = 0x0046;
2179pub const FILE_DEVICE_DEVAPI: DEVICE_TYPE = 0x0047;
2180pub const FILE_DEVICE_GPIO: DEVICE_TYPE = 0x0048;
2181pub const FILE_DEVICE_USBEX: DEVICE_TYPE = 0x0049;
2182pub const FILE_DEVICE_CONSOLE: DEVICE_TYPE = 0x0050;
2183pub const FILE_DEVICE_NFP: DEVICE_TYPE = 0x0051;
2184pub const FILE_DEVICE_SYSENV: DEVICE_TYPE = 0x0052;
2185pub const FILE_DEVICE_VIRTUAL_BLOCK: DEVICE_TYPE = 0x0053;
2186pub const FILE_DEVICE_POINT_OF_SERVICE: DEVICE_TYPE = 0x0054;
2187pub const FILE_DEVICE_STORAGE_REPLICATION: DEVICE_TYPE = 0x0055;
2188pub const FILE_DEVICE_TRUST_ENV: DEVICE_TYPE = 0x0056;
2189pub const FILE_DEVICE_UCM: DEVICE_TYPE = 0x0057;
2190pub const FILE_DEVICE_UCMTCPCI: DEVICE_TYPE = 0x0058;
2191pub const FILE_DEVICE_PERSISTENT_MEMORY: DEVICE_TYPE = 0x0059;
2192pub const FILE_DEVICE_NVDIMM: DEVICE_TYPE = 0x005a;
2193pub const FILE_DEVICE_HOLOGRAPHIC: DEVICE_TYPE = 0x005b;
2194pub const FILE_DEVICE_SDFXHCI: DEVICE_TYPE = 0x005c;
2195
2196/// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/buffer-descriptions-for-i-o-control-codes
2197pub const TransferType = enum(u2) {
2198 METHOD_BUFFERED = 0,
2199 METHOD_IN_DIRECT = 1,
2200 METHOD_OUT_DIRECT = 2,
2201 METHOD_NEITHER = 3,
2202};
2203
2204pub const FILE_ANY_ACCESS = 0;
2205pub const FILE_READ_ACCESS = 1;
2206pub const FILE_WRITE_ACCESS = 2;
2207
2208/// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/defining-i-o-control-codes
2209pub fn CTL_CODE(deviceType: u16, function: u12, method: TransferType, access: u2) DWORD {
2210 return (@as(DWORD, deviceType) << 16) |
2211 (@as(DWORD, access) << 14) |
2212 (@as(DWORD, function) << 2) |
2213 @enumToInt(method);
20322214}
2215
2216pub const INVALID_HANDLE_VALUE = @intToPtr(HANDLE, maxInt(usize));
2217
2218pub const INVALID_FILE_ATTRIBUTES = @as(DWORD, maxInt(DWORD));
2219
2220pub const FILE_ALL_INFORMATION = extern struct {
2221 BasicInformation: FILE_BASIC_INFORMATION,
2222 StandardInformation: FILE_STANDARD_INFORMATION,
2223 InternalInformation: FILE_INTERNAL_INFORMATION,
2224 EaInformation: FILE_EA_INFORMATION,
2225 AccessInformation: FILE_ACCESS_INFORMATION,
2226 PositionInformation: FILE_POSITION_INFORMATION,
2227 ModeInformation: FILE_MODE_INFORMATION,
2228 AlignmentInformation: FILE_ALIGNMENT_INFORMATION,
2229 NameInformation: FILE_NAME_INFORMATION,
2230};
2231
2232pub const FILE_BASIC_INFORMATION = extern struct {
2233 CreationTime: LARGE_INTEGER,
2234 LastAccessTime: LARGE_INTEGER,
2235 LastWriteTime: LARGE_INTEGER,
2236 ChangeTime: LARGE_INTEGER,
2237 FileAttributes: ULONG,
2238};
2239
2240pub const FILE_STANDARD_INFORMATION = extern struct {
2241 AllocationSize: LARGE_INTEGER,
2242 EndOfFile: LARGE_INTEGER,
2243 NumberOfLinks: ULONG,
2244 DeletePending: BOOLEAN,
2245 Directory: BOOLEAN,
2246};
2247
2248pub const FILE_INTERNAL_INFORMATION = extern struct {
2249 IndexNumber: LARGE_INTEGER,
2250};
2251
2252pub const FILE_EA_INFORMATION = extern struct {
2253 EaSize: ULONG,
2254};
2255
2256pub const FILE_ACCESS_INFORMATION = extern struct {
2257 AccessFlags: ACCESS_MASK,
2258};
2259
2260pub const FILE_POSITION_INFORMATION = extern struct {
2261 CurrentByteOffset: LARGE_INTEGER,
2262};
2263
2264pub const FILE_END_OF_FILE_INFORMATION = extern struct {
2265 EndOfFile: LARGE_INTEGER,
2266};
2267
2268pub const FILE_MODE_INFORMATION = extern struct {
2269 Mode: ULONG,
2270};
2271
2272pub const FILE_ALIGNMENT_INFORMATION = extern struct {
2273 AlignmentRequirement: ULONG,
2274};
2275
2276pub const FILE_NAME_INFORMATION = extern struct {
2277 FileNameLength: ULONG,
2278 FileName: [1]WCHAR,
2279};
2280
2281pub const FILE_RENAME_INFORMATION = extern struct {
2282 ReplaceIfExists: BOOLEAN,
2283 RootDirectory: ?HANDLE,
2284 FileNameLength: ULONG,
2285 FileName: [1]WCHAR,
2286};
2287
2288pub const IO_STATUS_BLOCK = extern struct {
2289 // "DUMMYUNIONNAME" expands to "u"
2290 u: extern union {
2291 Status: NTSTATUS,
2292 Pointer: ?*c_void,
2293 },
2294 Information: ULONG_PTR,
2295};
2296
2297pub const FILE_INFORMATION_CLASS = enum(c_int) {
2298 FileDirectoryInformation = 1,
2299 FileFullDirectoryInformation,
2300 FileBothDirectoryInformation,
2301 FileBasicInformation,
2302 FileStandardInformation,
2303 FileInternalInformation,
2304 FileEaInformation,
2305 FileAccessInformation,
2306 FileNameInformation,
2307 FileRenameInformation,
2308 FileLinkInformation,
2309 FileNamesInformation,
2310 FileDispositionInformation,
2311 FilePositionInformation,
2312 FileFullEaInformation,
2313 FileModeInformation,
2314 FileAlignmentInformation,
2315 FileAllInformation,
2316 FileAllocationInformation,
2317 FileEndOfFileInformation,
2318 FileAlternateNameInformation,
2319 FileStreamInformation,
2320 FilePipeInformation,
2321 FilePipeLocalInformation,
2322 FilePipeRemoteInformation,
2323 FileMailslotQueryInformation,
2324 FileMailslotSetInformation,
2325 FileCompressionInformation,
2326 FileObjectIdInformation,
2327 FileCompletionInformation,
2328 FileMoveClusterInformation,
2329 FileQuotaInformation,
2330 FileReparsePointInformation,
2331 FileNetworkOpenInformation,
2332 FileAttributeTagInformation,
2333 FileTrackingInformation,
2334 FileIdBothDirectoryInformation,
2335 FileIdFullDirectoryInformation,
2336 FileValidDataLengthInformation,
2337 FileShortNameInformation,
2338 FileIoCompletionNotificationInformation,
2339 FileIoStatusBlockRangeInformation,
2340 FileIoPriorityHintInformation,
2341 FileSfioReserveInformation,
2342 FileSfioVolumeInformation,
2343 FileHardLinkInformation,
2344 FileProcessIdsUsingFileInformation,
2345 FileNormalizedNameInformation,
2346 FileNetworkPhysicalNameInformation,
2347 FileIdGlobalTxDirectoryInformation,
2348 FileIsRemoteDeviceInformation,
2349 FileUnusedInformation,
2350 FileNumaNodeInformation,
2351 FileStandardLinkInformation,
2352 FileRemoteProtocolInformation,
2353 FileRenameInformationBypassAccessCheck,
2354 FileLinkInformationBypassAccessCheck,
2355 FileVolumeNameInformation,
2356 FileIdInformation,
2357 FileIdExtdDirectoryInformation,
2358 FileReplaceCompletionInformation,
2359 FileHardLinkFullIdInformation,
2360 FileIdExtdBothDirectoryInformation,
2361 FileDispositionInformationEx,
2362 FileRenameInformationEx,
2363 FileRenameInformationExBypassAccessCheck,
2364 FileDesiredStorageClassInformation,
2365 FileStatInformation,
2366 FileMemoryPartitionInformation,
2367 FileStatLxInformation,
2368 FileCaseSensitiveInformation,
2369 FileLinkInformationEx,
2370 FileLinkInformationExBypassAccessCheck,
2371 FileStorageReserveIdInformation,
2372 FileCaseSensitiveInformationForceAccessCheck,
2373 FileMaximumInformation,
2374};
2375
2376pub const OVERLAPPED = extern struct {
2377 Internal: ULONG_PTR,
2378 InternalHigh: ULONG_PTR,
2379 DUMMYUNIONNAME: extern union {
2380 DUMMYSTRUCTNAME: extern struct {
2381 Offset: DWORD,
2382 OffsetHigh: DWORD,
2383 },
2384 Pointer: ?PVOID,
2385 },
2386 hEvent: ?HANDLE,
2387};
2388
2389pub const OVERLAPPED_ENTRY = extern struct {
2390 lpCompletionKey: ULONG_PTR,
2391 lpOverlapped: *OVERLAPPED,
2392 Internal: ULONG_PTR,
2393 dwNumberOfBytesTransferred: DWORD,
2394};
2395
2396pub const MAX_PATH = 260;
2397
2398// TODO issue #305
2399pub const FILE_INFO_BY_HANDLE_CLASS = u32;
2400pub const FileBasicInfo = 0;
2401pub const FileStandardInfo = 1;
2402pub const FileNameInfo = 2;
2403pub const FileRenameInfo = 3;
2404pub const FileDispositionInfo = 4;
2405pub const FileAllocationInfo = 5;
2406pub const FileEndOfFileInfo = 6;
2407pub const FileStreamInfo = 7;
2408pub const FileCompressionInfo = 8;
2409pub const FileAttributeTagInfo = 9;
2410pub const FileIdBothDirectoryInfo = 10;
2411pub const FileIdBothDirectoryRestartInfo = 11;
2412pub const FileIoPriorityHintInfo = 12;
2413pub const FileRemoteProtocolInfo = 13;
2414pub const FileFullDirectoryInfo = 14;
2415pub const FileFullDirectoryRestartInfo = 15;
2416pub const FileStorageInfo = 16;
2417pub const FileAlignmentInfo = 17;
2418pub const FileIdInfo = 18;
2419pub const FileIdExtdDirectoryInfo = 19;
2420pub const FileIdExtdDirectoryRestartInfo = 20;
2421
2422pub const BY_HANDLE_FILE_INFORMATION = extern struct {
2423 dwFileAttributes: DWORD,
2424 ftCreationTime: FILETIME,
2425 ftLastAccessTime: FILETIME,
2426 ftLastWriteTime: FILETIME,
2427 dwVolumeSerialNumber: DWORD,
2428 nFileSizeHigh: DWORD,
2429 nFileSizeLow: DWORD,
2430 nNumberOfLinks: DWORD,
2431 nFileIndexHigh: DWORD,
2432 nFileIndexLow: DWORD,
2433};
2434
2435pub const FILE_NAME_INFO = extern struct {
2436 FileNameLength: DWORD,
2437 FileName: [1]WCHAR,
2438};
2439
2440/// Return the normalized drive name. This is the default.
2441pub const FILE_NAME_NORMALIZED = 0x0;
2442
2443/// Return the opened file name (not normalized).
2444pub const FILE_NAME_OPENED = 0x8;
2445
2446/// Return the path with the drive letter. This is the default.
2447pub const VOLUME_NAME_DOS = 0x0;
2448
2449/// Return the path with a volume GUID path instead of the drive name.
2450pub const VOLUME_NAME_GUID = 0x1;
2451
2452/// Return the path with no drive information.
2453pub const VOLUME_NAME_NONE = 0x4;
2454
2455/// Return the path with the volume device path.
2456pub const VOLUME_NAME_NT = 0x2;
2457
2458pub const SECURITY_ATTRIBUTES = extern struct {
2459 nLength: DWORD,
2460 lpSecurityDescriptor: ?*c_void,
2461 bInheritHandle: BOOL,
2462};
2463
2464pub const PIPE_ACCESS_INBOUND = 0x00000001;
2465pub const PIPE_ACCESS_OUTBOUND = 0x00000002;
2466pub const PIPE_ACCESS_DUPLEX = 0x00000003;
2467
2468pub const PIPE_TYPE_BYTE = 0x00000000;
2469pub const PIPE_TYPE_MESSAGE = 0x00000004;
2470
2471pub const PIPE_READMODE_BYTE = 0x00000000;
2472pub const PIPE_READMODE_MESSAGE = 0x00000002;
2473
2474pub const PIPE_WAIT = 0x00000000;
2475pub const PIPE_NOWAIT = 0x00000001;
2476
2477pub const GENERIC_READ = 0x80000000;
2478pub const GENERIC_WRITE = 0x40000000;
2479pub const GENERIC_EXECUTE = 0x20000000;
2480pub const GENERIC_ALL = 0x10000000;
2481
2482pub const FILE_SHARE_DELETE = 0x00000004;
2483pub const FILE_SHARE_READ = 0x00000001;
2484pub const FILE_SHARE_WRITE = 0x00000002;
2485
2486pub const DELETE = 0x00010000;
2487pub const READ_CONTROL = 0x00020000;
2488pub const WRITE_DAC = 0x00040000;
2489pub const WRITE_OWNER = 0x00080000;
2490pub const SYNCHRONIZE = 0x00100000;
2491pub const STANDARD_RIGHTS_READ = READ_CONTROL;
2492pub const STANDARD_RIGHTS_WRITE = READ_CONTROL;
2493pub const STANDARD_RIGHTS_EXECUTE = READ_CONTROL;
2494pub const STANDARD_RIGHTS_REQUIRED = DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER;
2495
2496// disposition for NtCreateFile
2497pub const FILE_SUPERSEDE = 0;
2498pub const FILE_OPEN = 1;
2499pub const FILE_CREATE = 2;
2500pub const FILE_OPEN_IF = 3;
2501pub const FILE_OVERWRITE = 4;
2502pub const FILE_OVERWRITE_IF = 5;
2503pub const FILE_MAXIMUM_DISPOSITION = 5;
2504
2505// flags for NtCreateFile and NtOpenFile
2506pub const FILE_READ_DATA = 0x00000001;
2507pub const FILE_LIST_DIRECTORY = 0x00000001;
2508pub const FILE_WRITE_DATA = 0x00000002;
2509pub const FILE_ADD_FILE = 0x00000002;
2510pub const FILE_APPEND_DATA = 0x00000004;
2511pub const FILE_ADD_SUBDIRECTORY = 0x00000004;
2512pub const FILE_CREATE_PIPE_INSTANCE = 0x00000004;
2513pub const FILE_READ_EA = 0x00000008;
2514pub const FILE_WRITE_EA = 0x00000010;
2515pub const FILE_EXECUTE = 0x00000020;
2516pub const FILE_TRAVERSE = 0x00000020;
2517pub const FILE_DELETE_CHILD = 0x00000040;
2518pub const FILE_READ_ATTRIBUTES = 0x00000080;
2519pub const FILE_WRITE_ATTRIBUTES = 0x00000100;
2520
2521pub const FILE_DIRECTORY_FILE = 0x00000001;
2522pub const FILE_WRITE_THROUGH = 0x00000002;
2523pub const FILE_SEQUENTIAL_ONLY = 0x00000004;
2524pub const FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008;
2525pub const FILE_SYNCHRONOUS_IO_ALERT = 0x00000010;
2526pub const FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020;
2527pub const FILE_NON_DIRECTORY_FILE = 0x00000040;
2528pub const FILE_CREATE_TREE_CONNECTION = 0x00000080;
2529pub const FILE_COMPLETE_IF_OPLOCKED = 0x00000100;
2530pub const FILE_NO_EA_KNOWLEDGE = 0x00000200;
2531pub const FILE_OPEN_FOR_RECOVERY = 0x00000400;
2532pub const FILE_RANDOM_ACCESS = 0x00000800;
2533pub const FILE_DELETE_ON_CLOSE = 0x00001000;
2534pub const FILE_OPEN_BY_FILE_ID = 0x00002000;
2535pub const FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000;
2536pub const FILE_NO_COMPRESSION = 0x00008000;
2537pub const FILE_RESERVE_OPFILTER = 0x00100000;
2538pub const FILE_OPEN_REPARSE_POINT = 0x00200000;
2539pub const FILE_OPEN_OFFLINE_FILE = 0x00400000;
2540pub const FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000;
2541
2542pub const CREATE_ALWAYS = 2;
2543pub const CREATE_NEW = 1;
2544pub const OPEN_ALWAYS = 4;
2545pub const OPEN_EXISTING = 3;
2546pub const TRUNCATE_EXISTING = 5;
2547
2548pub const FILE_ATTRIBUTE_ARCHIVE = 0x20;
2549pub const FILE_ATTRIBUTE_COMPRESSED = 0x800;
2550pub const FILE_ATTRIBUTE_DEVICE = 0x40;
2551pub const FILE_ATTRIBUTE_DIRECTORY = 0x10;
2552pub const FILE_ATTRIBUTE_ENCRYPTED = 0x4000;
2553pub const FILE_ATTRIBUTE_HIDDEN = 0x2;
2554pub const FILE_ATTRIBUTE_INTEGRITY_STREAM = 0x8000;
2555pub const FILE_ATTRIBUTE_NORMAL = 0x80;
2556pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x2000;
2557pub const FILE_ATTRIBUTE_NO_SCRUB_DATA = 0x20000;
2558pub const FILE_ATTRIBUTE_OFFLINE = 0x1000;
2559pub const FILE_ATTRIBUTE_READONLY = 0x1;
2560pub const FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x400000;
2561pub const FILE_ATTRIBUTE_RECALL_ON_OPEN = 0x40000;
2562pub const FILE_ATTRIBUTE_REPARSE_POINT = 0x400;
2563pub const FILE_ATTRIBUTE_SPARSE_FILE = 0x200;
2564pub const FILE_ATTRIBUTE_SYSTEM = 0x4;
2565pub const FILE_ATTRIBUTE_TEMPORARY = 0x100;
2566pub const FILE_ATTRIBUTE_VIRTUAL = 0x10000;
2567
2568// flags for CreateEvent
2569pub const CREATE_EVENT_INITIAL_SET = 0x00000002;
2570pub const CREATE_EVENT_MANUAL_RESET = 0x00000001;
2571
2572pub const EVENT_ALL_ACCESS = 0x1F0003;
2573pub const EVENT_MODIFY_STATE = 0x0002;
2574
2575pub const PROCESS_INFORMATION = extern struct {
2576 hProcess: HANDLE,
2577 hThread: HANDLE,
2578 dwProcessId: DWORD,
2579 dwThreadId: DWORD,
2580};
2581
2582pub const STARTUPINFOW = extern struct {
2583 cb: DWORD,
2584 lpReserved: ?LPWSTR,
2585 lpDesktop: ?LPWSTR,
2586 lpTitle: ?LPWSTR,
2587 dwX: DWORD,
2588 dwY: DWORD,
2589 dwXSize: DWORD,
2590 dwYSize: DWORD,
2591 dwXCountChars: DWORD,
2592 dwYCountChars: DWORD,
2593 dwFillAttribute: DWORD,
2594 dwFlags: DWORD,
2595 wShowWindow: WORD,
2596 cbReserved2: WORD,
2597 lpReserved2: ?*BYTE,
2598 hStdInput: ?HANDLE,
2599 hStdOutput: ?HANDLE,
2600 hStdError: ?HANDLE,
2601};
2602
2603pub const STARTF_FORCEONFEEDBACK = 0x00000040;
2604pub const STARTF_FORCEOFFFEEDBACK = 0x00000080;
2605pub const STARTF_PREVENTPINNING = 0x00002000;
2606pub const STARTF_RUNFULLSCREEN = 0x00000020;
2607pub const STARTF_TITLEISAPPID = 0x00001000;
2608pub const STARTF_TITLEISLINKNAME = 0x00000800;
2609pub const STARTF_UNTRUSTEDSOURCE = 0x00008000;
2610pub const STARTF_USECOUNTCHARS = 0x00000008;
2611pub const STARTF_USEFILLATTRIBUTE = 0x00000010;
2612pub const STARTF_USEHOTKEY = 0x00000200;
2613pub const STARTF_USEPOSITION = 0x00000004;
2614pub const STARTF_USESHOWWINDOW = 0x00000001;
2615pub const STARTF_USESIZE = 0x00000002;
2616pub const STARTF_USESTDHANDLES = 0x00000100;
2617
2618pub const INFINITE = 4294967295;
2619
2620pub const MAXIMUM_WAIT_OBJECTS = 64;
2621
2622pub const WAIT_ABANDONED = 0x00000080;
2623pub const WAIT_ABANDONED_0 = WAIT_ABANDONED + 0;
2624pub const WAIT_OBJECT_0 = 0x00000000;
2625pub const WAIT_TIMEOUT = 0x00000102;
2626pub const WAIT_FAILED = 0xFFFFFFFF;
2627
2628pub const HANDLE_FLAG_INHERIT = 0x00000001;
2629pub const HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x00000002;
2630
2631pub const MOVEFILE_COPY_ALLOWED = 2;
2632pub const MOVEFILE_CREATE_HARDLINK = 16;
2633pub const MOVEFILE_DELAY_UNTIL_REBOOT = 4;
2634pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE = 32;
2635pub const MOVEFILE_REPLACE_EXISTING = 1;
2636pub const MOVEFILE_WRITE_THROUGH = 8;
2637
2638pub const FILE_BEGIN = 0;
2639pub const FILE_CURRENT = 1;
2640pub const FILE_END = 2;
2641
2642pub const HEAP_CREATE_ENABLE_EXECUTE = 0x00040000;
2643pub const HEAP_REALLOC_IN_PLACE_ONLY = 0x00000010;
2644pub const HEAP_GENERATE_EXCEPTIONS = 0x00000004;
2645pub const HEAP_NO_SERIALIZE = 0x00000001;
2646
2647// AllocationType values
2648pub const MEM_COMMIT = 0x1000;
2649pub const MEM_RESERVE = 0x2000;
2650pub const MEM_RESET = 0x80000;
2651pub const MEM_RESET_UNDO = 0x1000000;
2652pub const MEM_LARGE_PAGES = 0x20000000;
2653pub const MEM_PHYSICAL = 0x400000;
2654pub const MEM_TOP_DOWN = 0x100000;
2655pub const MEM_WRITE_WATCH = 0x200000;
2656
2657// Protect values
2658pub const PAGE_EXECUTE = 0x10;
2659pub const PAGE_EXECUTE_READ = 0x20;
2660pub const PAGE_EXECUTE_READWRITE = 0x40;
2661pub const PAGE_EXECUTE_WRITECOPY = 0x80;
2662pub const PAGE_NOACCESS = 0x01;
2663pub const PAGE_READONLY = 0x02;
2664pub const PAGE_READWRITE = 0x04;
2665pub const PAGE_WRITECOPY = 0x08;
2666pub const PAGE_TARGETS_INVALID = 0x40000000;
2667pub const PAGE_TARGETS_NO_UPDATE = 0x40000000; // Same as PAGE_TARGETS_INVALID
2668pub const PAGE_GUARD = 0x100;
2669pub const PAGE_NOCACHE = 0x200;
2670pub const PAGE_WRITECOMBINE = 0x400;
2671
2672// FreeType values
2673pub const MEM_COALESCE_PLACEHOLDERS = 0x1;
2674pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
2675pub const MEM_DECOMMIT = 0x4000;
2676pub const MEM_RELEASE = 0x8000;
2677
2678pub const PTHREAD_START_ROUTINE = fn (LPVOID) callconv(.C) DWORD;
2679pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
2680
2681pub const WIN32_FIND_DATAW = extern struct {
2682 dwFileAttributes: DWORD,
2683 ftCreationTime: FILETIME,
2684 ftLastAccessTime: FILETIME,
2685 ftLastWriteTime: FILETIME,
2686 nFileSizeHigh: DWORD,
2687 nFileSizeLow: DWORD,
2688 dwReserved0: DWORD,
2689 dwReserved1: DWORD,
2690 cFileName: [260]u16,
2691 cAlternateFileName: [14]u16,
2692};
2693
2694pub const FILETIME = extern struct {
2695 dwLowDateTime: DWORD,
2696 dwHighDateTime: DWORD,
2697};
2698
2699pub const SYSTEM_INFO = extern struct {
2700 anon1: extern union {
2701 dwOemId: DWORD,
2702 anon2: extern struct {
2703 wProcessorArchitecture: WORD,
2704 wReserved: WORD,
2705 },
2706 },
2707 dwPageSize: DWORD,
2708 lpMinimumApplicationAddress: LPVOID,
2709 lpMaximumApplicationAddress: LPVOID,
2710 dwActiveProcessorMask: DWORD_PTR,
2711 dwNumberOfProcessors: DWORD,
2712 dwProcessorType: DWORD,
2713 dwAllocationGranularity: DWORD,
2714 wProcessorLevel: WORD,
2715 wProcessorRevision: WORD,
2716};
2717
2718pub const HRESULT = c_long;
2719
2720pub const KNOWNFOLDERID = GUID;
2721pub const GUID = extern struct {
2722 Data1: c_ulong,
2723 Data2: c_ushort,
2724 Data3: c_ushort,
2725 Data4: [8]u8,
2726
2727 pub fn parse(str: []const u8) GUID {
2728 var guid: GUID = undefined;
2729 var index: usize = 0;
2730 assert(str[index] == '{');
2731 index += 1;
2732
2733 guid.Data1 = std.fmt.parseUnsigned(c_ulong, str[index .. index + 8], 16) catch unreachable;
2734 index += 8;
2735
2736 assert(str[index] == '-');
2737 index += 1;
2738
2739 guid.Data2 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
2740 index += 4;
2741
2742 assert(str[index] == '-');
2743 index += 1;
2744
2745 guid.Data3 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
2746 index += 4;
2747
2748 assert(str[index] == '-');
2749 index += 1;
2750
2751 guid.Data4[0] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
2752 index += 2;
2753 guid.Data4[1] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
2754 index += 2;
2755
2756 assert(str[index] == '-');
2757 index += 1;
2758
2759 var i: usize = 2;
2760 while (i < guid.Data4.len) : (i += 1) {
2761 guid.Data4[i] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
2762 index += 2;
2763 }
2764
2765 assert(str[index] == '}');
2766 index += 1;
2767 return guid;
2768 }
2769};
2770
2771pub const FOLDERID_LocalAppData = GUID.parse("{F1B32785-6FBA-4FCF-9D55-7B8E7F157091}");
2772
2773pub const KF_FLAG_DEFAULT = 0;
2774pub const KF_FLAG_NO_APPCONTAINER_REDIRECTION = 65536;
2775pub const KF_FLAG_CREATE = 32768;
2776pub const KF_FLAG_DONT_VERIFY = 16384;
2777pub const KF_FLAG_DONT_UNEXPAND = 8192;
2778pub const KF_FLAG_NO_ALIAS = 4096;
2779pub const KF_FLAG_INIT = 2048;
2780pub const KF_FLAG_DEFAULT_PATH = 1024;
2781pub const KF_FLAG_NOT_PARENT_RELATIVE = 512;
2782pub const KF_FLAG_SIMPLE_IDLIST = 256;
2783pub const KF_FLAG_ALIAS_ONLY = -2147483648;
2784
2785pub const S_OK = 0;
2786pub const E_NOTIMPL = @bitCast(c_long, @as(c_ulong, 0x80004001));
2787pub const E_NOINTERFACE = @bitCast(c_long, @as(c_ulong, 0x80004002));
2788pub const E_POINTER = @bitCast(c_long, @as(c_ulong, 0x80004003));
2789pub const E_ABORT = @bitCast(c_long, @as(c_ulong, 0x80004004));
2790pub const E_FAIL = @bitCast(c_long, @as(c_ulong, 0x80004005));
2791pub const E_UNEXPECTED = @bitCast(c_long, @as(c_ulong, 0x8000FFFF));
2792pub const E_ACCESSDENIED = @bitCast(c_long, @as(c_ulong, 0x80070005));
2793pub const E_HANDLE = @bitCast(c_long, @as(c_ulong, 0x80070006));
2794pub const E_OUTOFMEMORY = @bitCast(c_long, @as(c_ulong, 0x8007000E));
2795pub const E_INVALIDARG = @bitCast(c_long, @as(c_ulong, 0x80070057));
2796
2797pub const FILE_FLAG_BACKUP_SEMANTICS = 0x02000000;
2798pub const FILE_FLAG_DELETE_ON_CLOSE = 0x04000000;
2799pub const FILE_FLAG_NO_BUFFERING = 0x20000000;
2800pub const FILE_FLAG_OPEN_NO_RECALL = 0x00100000;
2801pub const FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000;
2802pub const FILE_FLAG_OVERLAPPED = 0x40000000;
2803pub const FILE_FLAG_POSIX_SEMANTICS = 0x0100000;
2804pub const FILE_FLAG_RANDOM_ACCESS = 0x10000000;
2805pub const FILE_FLAG_SESSION_AWARE = 0x00800000;
2806pub const FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000;
2807pub const FILE_FLAG_WRITE_THROUGH = 0x80000000;
2808
2809pub const RECT = extern struct {
2810 left: LONG,
2811 top: LONG,
2812 right: LONG,
2813 bottom: LONG,
2814};
2815
2816pub const SMALL_RECT = extern struct {
2817 Left: SHORT,
2818 Top: SHORT,
2819 Right: SHORT,
2820 Bottom: SHORT,
2821};
2822
2823pub const POINT = extern struct {
2824 x: LONG,
2825 y: LONG,
2826};
2827
2828pub const COORD = extern struct {
2829 X: SHORT,
2830 Y: SHORT,
2831};
2832
2833pub const CREATE_UNICODE_ENVIRONMENT = 1024;
2834
2835pub const TLS_OUT_OF_INDEXES = 4294967295;
2836pub const IMAGE_TLS_DIRECTORY = extern struct {
2837 StartAddressOfRawData: usize,
2838 EndAddressOfRawData: usize,
2839 AddressOfIndex: usize,
2840 AddressOfCallBacks: usize,
2841 SizeOfZeroFill: u32,
2842 Characteristics: u32,
2843};
2844pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
2845pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;
2846
2847pub const PIMAGE_TLS_CALLBACK = ?fn (PVOID, DWORD, PVOID) callconv(.C) void;
2848
2849pub const PROV_RSA_FULL = 1;
2850
2851pub const REGSAM = ACCESS_MASK;
2852pub const ACCESS_MASK = DWORD;
2853pub const HKEY = *HKEY__;
2854pub const HKEY__ = extern struct {
2855 unused: c_int,
2856};
2857pub const LSTATUS = LONG;
2858
2859pub const FILE_NOTIFY_INFORMATION = extern struct {
2860 NextEntryOffset: DWORD,
2861 Action: DWORD,
2862 FileNameLength: DWORD,
2863 // Flexible array member
2864 // FileName: [1]WCHAR,
2865};
2866
2867pub const FILE_ACTION_ADDED = 0x00000001;
2868pub const FILE_ACTION_REMOVED = 0x00000002;
2869pub const FILE_ACTION_MODIFIED = 0x00000003;
2870pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
2871pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
2872
2873pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void;
2874
2875pub const FILE_NOTIFY_CHANGE_CREATION = 64;
2876pub const FILE_NOTIFY_CHANGE_SIZE = 8;
2877pub const FILE_NOTIFY_CHANGE_SECURITY = 256;
2878pub const FILE_NOTIFY_CHANGE_LAST_ACCESS = 32;
2879pub const FILE_NOTIFY_CHANGE_LAST_WRITE = 16;
2880pub const FILE_NOTIFY_CHANGE_DIR_NAME = 2;
2881pub const FILE_NOTIFY_CHANGE_FILE_NAME = 1;
2882pub const FILE_NOTIFY_CHANGE_ATTRIBUTES = 4;
2883
2884pub const CONSOLE_SCREEN_BUFFER_INFO = extern struct {
2885 dwSize: COORD,
2886 dwCursorPosition: COORD,
2887 wAttributes: WORD,
2888 srWindow: SMALL_RECT,
2889 dwMaximumWindowSize: COORD,
2890};
2891
2892pub const FOREGROUND_BLUE = 1;
2893pub const FOREGROUND_GREEN = 2;
2894pub const FOREGROUND_RED = 4;
2895pub const FOREGROUND_INTENSITY = 8;
2896
2897pub const LIST_ENTRY = extern struct {
2898 Flink: *LIST_ENTRY,
2899 Blink: *LIST_ENTRY,
2900};
2901
2902pub const RTL_CRITICAL_SECTION_DEBUG = extern struct {
2903 Type: WORD,
2904 CreatorBackTraceIndex: WORD,
2905 CriticalSection: *RTL_CRITICAL_SECTION,
2906 ProcessLocksList: LIST_ENTRY,
2907 EntryCount: DWORD,
2908 ContentionCount: DWORD,
2909 Flags: DWORD,
2910 CreatorBackTraceIndexHigh: WORD,
2911 SpareWORD: WORD,
2912};
2913
2914pub const RTL_CRITICAL_SECTION = extern struct {
2915 DebugInfo: *RTL_CRITICAL_SECTION_DEBUG,
2916 LockCount: LONG,
2917 RecursionCount: LONG,
2918 OwningThread: HANDLE,
2919 LockSemaphore: HANDLE,
2920 SpinCount: ULONG_PTR,
2921};
2922
2923pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
2924pub const INIT_ONCE = RTL_RUN_ONCE;
2925pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;
2926pub const INIT_ONCE_FN = fn (InitOnce: *INIT_ONCE, Parameter: ?*c_void, Context: ?*c_void) callconv(.C) BOOL;
2927
2928pub const RTL_RUN_ONCE = extern struct {
2929 Ptr: ?*c_void,
2930};
2931
2932pub const RTL_RUN_ONCE_INIT = RTL_RUN_ONCE{ .Ptr = null };
2933
2934pub const COINIT_APARTMENTTHREADED = COINIT.COINIT_APARTMENTTHREADED;
2935pub const COINIT_MULTITHREADED = COINIT.COINIT_MULTITHREADED;
2936pub const COINIT_DISABLE_OLE1DDE = COINIT.COINIT_DISABLE_OLE1DDE;
2937pub const COINIT_SPEED_OVER_MEMORY = COINIT.COINIT_SPEED_OVER_MEMORY;
2938pub const COINIT = enum(c_int) {
2939 COINIT_APARTMENTTHREADED = 2,
2940 COINIT_MULTITHREADED = 0,
2941 COINIT_DISABLE_OLE1DDE = 4,
2942 COINIT_SPEED_OVER_MEMORY = 8,
2943};
2944
2945/// > The maximum path of 32,767 characters is approximate, because the "\\?\"
2946/// > prefix may be expanded to a longer string by the system at run time, and
2947/// > this expansion applies to the total length.
2948/// from https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation
2949pub const PATH_MAX_WIDE = 32767;
2950
2951pub const FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
2952pub const FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
2953pub const FORMAT_MESSAGE_FROM_HMODULE = 0x00000800;
2954pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400;
2955pub const FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
2956pub const FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
2957pub const FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF;
2958
2959pub const EXCEPTION_DATATYPE_MISALIGNMENT = 0x80000002;
2960pub const EXCEPTION_ACCESS_VIOLATION = 0xc0000005;
2961pub const EXCEPTION_ILLEGAL_INSTRUCTION = 0xc000001d;
2962pub const EXCEPTION_STACK_OVERFLOW = 0xc00000fd;
2963pub const EXCEPTION_CONTINUE_SEARCH = 0;
2964
2965pub const EXCEPTION_RECORD = extern struct {
2966 ExceptionCode: u32,
2967 ExceptionFlags: u32,
2968 ExceptionRecord: *EXCEPTION_RECORD,
2969 ExceptionAddress: *c_void,
2970 NumberParameters: u32,
2971 ExceptionInformation: [15]usize,
2972};
2973
2974const arch_bits = switch (native_arch) {
2975 .i386 => struct {
2976 pub const FLOATING_SAVE_AREA = extern struct {
2977 ControlWord: DWORD,
2978 StatusWord: DWORD,
2979 TagWord: DWORD,
2980 ErrorOffset: DWORD,
2981 ErrorSelector: DWORD,
2982 DataOffset: DWORD,
2983 DataSelector: DWORD,
2984 RegisterArea: [80]BYTE,
2985 Cr0NpxState: DWORD,
2986 };
2987
2988 pub const CONTEXT = extern struct {
2989 ContextFlags: DWORD,
2990 Dr0: DWORD,
2991 Dr1: DWORD,
2992 Dr2: DWORD,
2993 Dr3: DWORD,
2994 Dr6: DWORD,
2995 Dr7: DWORD,
2996 FloatSave: FLOATING_SAVE_AREA,
2997 SegGs: DWORD,
2998 SegFs: DWORD,
2999 SegEs: DWORD,
3000 SegDs: DWORD,
3001 Edi: DWORD,
3002 Esi: DWORD,
3003 Ebx: DWORD,
3004 Edx: DWORD,
3005 Ecx: DWORD,
3006 Eax: DWORD,
3007 Ebp: DWORD,
3008 Eip: DWORD,
3009 SegCs: DWORD,
3010 EFlags: DWORD,
3011 Esp: DWORD,
3012 SegSs: DWORD,
3013 ExtendedRegisters: [512]BYTE,
3014
3015 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
3016 return .{ .bp = ctx.Ebp, .ip = ctx.Eip };
3017 }
3018 };
3019 },
3020 .x86_64 => struct {
3021 pub const M128A = extern struct {
3022 Low: ULONGLONG,
3023 High: LONGLONG,
3024 };
3025
3026 pub const XMM_SAVE_AREA32 = extern struct {
3027 ControlWord: WORD,
3028 StatusWord: WORD,
3029 TagWord: BYTE,
3030 Reserved1: BYTE,
3031 ErrorOpcode: WORD,
3032 ErrorOffset: DWORD,
3033 ErrorSelector: WORD,
3034 Reserved2: WORD,
3035 DataOffset: DWORD,
3036 DataSelector: WORD,
3037 Reserved3: WORD,
3038 MxCsr: DWORD,
3039 MxCsr_Mask: DWORD,
3040 FloatRegisters: [8]arch_bits.M128A,
3041 XmmRegisters: [16]arch_bits.M128A,
3042 Reserved4: [96]BYTE,
3043 };
3044
3045 pub const CONTEXT = extern struct {
3046 P1Home: DWORD64,
3047 P2Home: DWORD64,
3048 P3Home: DWORD64,
3049 P4Home: DWORD64,
3050 P5Home: DWORD64,
3051 P6Home: DWORD64,
3052 ContextFlags: DWORD,
3053 MxCsr: DWORD,
3054 SegCs: WORD,
3055 SegDs: WORD,
3056 SegEs: WORD,
3057 SegFs: WORD,
3058 SegGs: WORD,
3059 SegSs: WORD,
3060 EFlags: DWORD,
3061 Dr0: DWORD64,
3062 Dr1: DWORD64,
3063 Dr2: DWORD64,
3064 Dr3: DWORD64,
3065 Dr6: DWORD64,
3066 Dr7: DWORD64,
3067 Rax: DWORD64,
3068 Rcx: DWORD64,
3069 Rdx: DWORD64,
3070 Rbx: DWORD64,
3071 Rsp: DWORD64,
3072 Rbp: DWORD64,
3073 Rsi: DWORD64,
3074 Rdi: DWORD64,
3075 R8: DWORD64,
3076 R9: DWORD64,
3077 R10: DWORD64,
3078 R11: DWORD64,
3079 R12: DWORD64,
3080 R13: DWORD64,
3081 R14: DWORD64,
3082 R15: DWORD64,
3083 Rip: DWORD64,
3084 DUMMYUNIONNAME: extern union {
3085 FltSave: arch_bits.XMM_SAVE_AREA32,
3086 FloatSave: arch_bits.XMM_SAVE_AREA32,
3087 DUMMYSTRUCTNAME: extern struct {
3088 Header: [2]M128A,
3089 Legacy: [8]M128A,
3090 Xmm0: M128A,
3091 Xmm1: M128A,
3092 Xmm2: M128A,
3093 Xmm3: M128A,
3094 Xmm4: M128A,
3095 Xmm5: M128A,
3096 Xmm6: M128A,
3097 Xmm7: M128A,
3098 Xmm8: M128A,
3099 Xmm9: M128A,
3100 Xmm10: M128A,
3101 Xmm11: M128A,
3102 Xmm12: M128A,
3103 Xmm13: M128A,
3104 Xmm14: M128A,
3105 Xmm15: M128A,
3106 },
3107 },
3108 VectorRegister: [26]M128A,
3109 VectorControl: DWORD64,
3110 DebugControl: DWORD64,
3111 LastBranchToRip: DWORD64,
3112 LastBranchFromRip: DWORD64,
3113 LastExceptionToRip: DWORD64,
3114 LastExceptionFromRip: DWORD64,
3115
3116 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
3117 return .{ .bp = ctx.Rbp, .ip = ctx.Rip };
3118 }
3119 };
3120 },
3121 .aarch64 => struct {
3122 pub const NEON128 = extern union {
3123 DUMMYSTRUCTNAME: extern struct {
3124 Low: ULONGLONG,
3125 High: LONGLONG,
3126 },
3127 D: [2]f64,
3128 S: [4]f32,
3129 H: [8]WORD,
3130 B: [16]BYTE,
3131 };
3132
3133 pub const CONTEXT = extern struct {
3134 ContextFlags: ULONG,
3135 Cpsr: ULONG,
3136 DUMMYUNIONNAME: extern union {
3137 DUMMYSTRUCTNAME: extern struct {
3138 X0: DWORD64,
3139 X1: DWORD64,
3140 X2: DWORD64,
3141 X3: DWORD64,
3142 X4: DWORD64,
3143 X5: DWORD64,
3144 X6: DWORD64,
3145 X7: DWORD64,
3146 X8: DWORD64,
3147 X9: DWORD64,
3148 X10: DWORD64,
3149 X11: DWORD64,
3150 X12: DWORD64,
3151 X13: DWORD64,
3152 X14: DWORD64,
3153 X15: DWORD64,
3154 X16: DWORD64,
3155 X17: DWORD64,
3156 X18: DWORD64,
3157 X19: DWORD64,
3158 X20: DWORD64,
3159 X21: DWORD64,
3160 X22: DWORD64,
3161 X23: DWORD64,
3162 X24: DWORD64,
3163 X25: DWORD64,
3164 X26: DWORD64,
3165 X27: DWORD64,
3166 X28: DWORD64,
3167 Fp: DWORD64,
3168 Lr: DWORD64,
3169 },
3170 X: [31]DWORD64,
3171 },
3172 Sp: DWORD64,
3173 Pc: DWORD64,
3174 V: [32]NEON128,
3175 Fpcr: DWORD,
3176 Fpsr: DWORD,
3177 Bcr: [8]DWORD,
3178 Bvr: [8]DWORD64,
3179 Wcr: [2]DWORD,
3180 Wvr: [2]DWORD64,
3181
3182 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
3183 return .{
3184 .bp = ctx.DUMMYUNIONNAME.DUMMYSTRUCTNAME.Fp,
3185 .ip = ctx.Pc,
3186 };
3187 }
3188 };
3189 },
3190 else => struct {},
3191};
3192pub const M128A = arch_bits.M128A;
3193pub const XMM_SAVE_AREA32 = arch_bits.XMM_SAVE_AREA32;
3194pub const CONTEXT = arch_bits.CONTEXT;
3195pub const FLOATING_SAVE_AREA = arch_bits.FLOATING_SAVE_AREA;
3196pub const NEON128 = arch_bits.NEON128;
3197
3198pub const EXCEPTION_POINTERS = extern struct {
3199 ExceptionRecord: *EXCEPTION_RECORD,
3200 ContextRecord: *CONTEXT,
3201};
3202
3203pub const VECTORED_EXCEPTION_HANDLER = fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long;
3204
3205pub const OBJECT_ATTRIBUTES = extern struct {
3206 Length: ULONG,
3207 RootDirectory: ?HANDLE,
3208 ObjectName: *UNICODE_STRING,
3209 Attributes: ULONG,
3210 SecurityDescriptor: ?*c_void,
3211 SecurityQualityOfService: ?*c_void,
3212};
3213
3214pub const OBJ_INHERIT = 0x00000002;
3215pub const OBJ_PERMANENT = 0x00000010;
3216pub const OBJ_EXCLUSIVE = 0x00000020;
3217pub const OBJ_CASE_INSENSITIVE = 0x00000040;
3218pub const OBJ_OPENIF = 0x00000080;
3219pub const OBJ_OPENLINK = 0x00000100;
3220pub const OBJ_KERNEL_HANDLE = 0x00000200;
3221pub const OBJ_VALID_ATTRIBUTES = 0x000003F2;
3222
3223pub const UNICODE_STRING = extern struct {
3224 Length: c_ushort,
3225 MaximumLength: c_ushort,
3226 Buffer: [*]WCHAR,
3227};
3228
3229pub const ACTIVATION_CONTEXT_DATA = opaque {};
3230pub const ASSEMBLY_STORAGE_MAP = opaque {};
3231pub const FLS_CALLBACK_INFO = opaque {};
3232pub const RTL_BITMAP = opaque {};
3233pub const KAFFINITY = usize;
3234
3235pub const TEB = extern struct {
3236 Reserved1: [12]PVOID,
3237 ProcessEnvironmentBlock: *PEB,
3238 Reserved2: [399]PVOID,
3239 Reserved3: [1952]u8,
3240 TlsSlots: [64]PVOID,
3241 Reserved4: [8]u8,
3242 Reserved5: [26]PVOID,
3243 ReservedForOle: PVOID,
3244 Reserved6: [4]PVOID,
3245 TlsExpansionSlots: PVOID,
3246};
3247
3248/// Process Environment Block
3249/// Microsoft documentation of this is incomplete, the fields here are taken from various resources including:
3250/// - https://github.com/wine-mirror/wine/blob/1aff1e6a370ee8c0213a0fd4b220d121da8527aa/include/winternl.h#L269
3251/// - https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/index.htm
3252pub const PEB = extern struct {
3253 // Versions: All
3254 InheritedAddressSpace: BOOLEAN,
3255
3256 // Versions: 3.51+
3257 ReadImageFileExecOptions: BOOLEAN,
3258 BeingDebugged: BOOLEAN,
3259
3260 // Versions: 5.2+ (previously was padding)
3261 BitField: UCHAR,
3262
3263 // Versions: all
3264 Mutant: HANDLE,
3265 ImageBaseAddress: HMODULE,
3266 Ldr: *PEB_LDR_DATA,
3267 ProcessParameters: *RTL_USER_PROCESS_PARAMETERS,
3268 SubSystemData: PVOID,
3269 ProcessHeap: HANDLE,
3270
3271 // Versions: 5.1+
3272 FastPebLock: *RTL_CRITICAL_SECTION,
3273
3274 // Versions: 5.2+
3275 AtlThunkSListPtr: PVOID,
3276 IFEOKey: PVOID,
3277
3278 // Versions: 6.0+
3279
3280 /// https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/crossprocessflags.htm
3281 CrossProcessFlags: ULONG,
3282
3283 // Versions: 6.0+
3284 union1: extern union {
3285 KernelCallbackTable: PVOID,
3286 UserSharedInfoPtr: PVOID,
3287 },
3288
3289 // Versions: 5.1+
3290 SystemReserved: ULONG,
3291
3292 // Versions: 5.1, (not 5.2, not 6.0), 6.1+
3293 AtlThunkSListPtr32: ULONG,
3294
3295 // Versions: 6.1+
3296 ApiSetMap: PVOID,
3297
3298 // Versions: all
3299 TlsExpansionCounter: ULONG,
3300 // note: there is padding here on 64 bit
3301 TlsBitmap: *RTL_BITMAP,
3302 TlsBitmapBits: [2]ULONG,
3303 ReadOnlySharedMemoryBase: PVOID,
3304
3305 // Versions: 1703+
3306 SharedData: PVOID,
3307
3308 // Versions: all
3309 ReadOnlyStaticServerData: *PVOID,
3310 AnsiCodePageData: PVOID,
3311 OemCodePageData: PVOID,
3312 UnicodeCaseTableData: PVOID,
3313
3314 // Versions: 3.51+
3315 NumberOfProcessors: ULONG,
3316 NtGlobalFlag: ULONG,
3317
3318 // Versions: all
3319 CriticalSectionTimeout: LARGE_INTEGER,
3320
3321 // End of Original PEB size
3322
3323 // Fields appended in 3.51:
3324 HeapSegmentReserve: ULONG_PTR,
3325 HeapSegmentCommit: ULONG_PTR,
3326 HeapDeCommitTotalFreeThreshold: ULONG_PTR,
3327 HeapDeCommitFreeBlockThreshold: ULONG_PTR,
3328 NumberOfHeaps: ULONG,
3329 MaximumNumberOfHeaps: ULONG,
3330 ProcessHeaps: *PVOID,
3331
3332 // Fields appended in 4.0:
3333 GdiSharedHandleTable: PVOID,
3334 ProcessStarterHelper: PVOID,
3335 GdiDCAttributeList: ULONG,
3336 // note: there is padding here on 64 bit
3337 LoaderLock: *RTL_CRITICAL_SECTION,
3338 OSMajorVersion: ULONG,
3339 OSMinorVersion: ULONG,
3340 OSBuildNumber: USHORT,
3341 OSCSDVersion: USHORT,
3342 OSPlatformId: ULONG,
3343 ImageSubSystem: ULONG,
3344 ImageSubSystemMajorVersion: ULONG,
3345 ImageSubSystemMinorVersion: ULONG,
3346 // note: there is padding here on 64 bit
3347 ActiveProcessAffinityMask: KAFFINITY,
3348 GdiHandleBuffer: [
3349 switch (@sizeOf(usize)) {
3350 4 => 0x22,
3351 8 => 0x3C,
3352 else => unreachable,
3353 }
3354 ]ULONG,
3355
3356 // Fields appended in 5.0 (Windows 2000):
3357 PostProcessInitRoutine: PVOID,
3358 TlsExpansionBitmap: *RTL_BITMAP,
3359 TlsExpansionBitmapBits: [32]ULONG,
3360 SessionId: ULONG,
3361 // note: there is padding here on 64 bit
3362 // Versions: 5.1+
3363 AppCompatFlags: ULARGE_INTEGER,
3364 AppCompatFlagsUser: ULARGE_INTEGER,
3365 ShimData: PVOID,
3366 // Versions: 5.0+
3367 AppCompatInfo: PVOID,
3368 CSDVersion: UNICODE_STRING,
3369
3370 // Fields appended in 5.1 (Windows XP):
3371 ActivationContextData: *const ACTIVATION_CONTEXT_DATA,
3372 ProcessAssemblyStorageMap: *ASSEMBLY_STORAGE_MAP,
3373 SystemDefaultActivationData: *const ACTIVATION_CONTEXT_DATA,
3374 SystemAssemblyStorageMap: *ASSEMBLY_STORAGE_MAP,
3375 MinimumStackCommit: ULONG_PTR,
3376
3377 // Fields appended in 5.2 (Windows Server 2003):
3378 FlsCallback: *FLS_CALLBACK_INFO,
3379 FlsListHead: LIST_ENTRY,
3380 FlsBitmap: *RTL_BITMAP,
3381 FlsBitmapBits: [4]ULONG,
3382 FlsHighIndex: ULONG,
3383
3384 // Fields appended in 6.0 (Windows Vista):
3385 WerRegistrationData: PVOID,
3386 WerShipAssertPtr: PVOID,
3387
3388 // Fields appended in 6.1 (Windows 7):
3389 pUnused: PVOID, // previously pContextData
3390 pImageHeaderHash: PVOID,
3391
3392 /// TODO: https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/tracingflags.htm
3393 TracingFlags: ULONG,
3394
3395 // Fields appended in 6.2 (Windows 8):
3396 CsrServerReadOnlySharedMemoryBase: ULONGLONG,
3397
3398 // Fields appended in 1511:
3399 TppWorkerpListLock: ULONG,
3400 TppWorkerpList: LIST_ENTRY,
3401 WaitOnAddressHashTable: [0x80]PVOID,
3402
3403 // Fields appended in 1709:
3404 TelemetryCoverageHeader: PVOID,
3405 CloudFileFlags: ULONG,
3406};
3407
3408/// The `PEB_LDR_DATA` structure is the main record of what modules are loaded in a process.
3409/// It is essentially the head of three double-linked lists of `LDR_DATA_TABLE_ENTRY` structures which each represent one loaded module.
3410///
3411/// Microsoft documentation of this is incomplete, the fields here are taken from various resources including:
3412/// - https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb_ldr_data.htm
3413pub const PEB_LDR_DATA = extern struct {
3414 // Versions: 3.51 and higher
3415 /// The size in bytes of the structure
3416 Length: ULONG,
3417
3418 /// TRUE if the structure is prepared.
3419 Initialized: BOOLEAN,
3420
3421 SsHandle: PVOID,
3422 InLoadOrderModuleList: LIST_ENTRY,
3423 InMemoryOrderModuleList: LIST_ENTRY,
3424 InInitializationOrderModuleList: LIST_ENTRY,
3425
3426 // Versions: 5.1 and higher
3427
3428 /// No known use of this field is known in Windows 8 and higher.
3429 EntryInProgress: PVOID,
3430
3431 // Versions: 6.0 from Windows Vista SP1, and higher
3432 ShutdownInProgress: BOOLEAN,
3433
3434 /// Though ShutdownThreadId is declared as a HANDLE,
3435 /// it is indeed the thread ID as suggested by its name.
3436 /// It is picked up from the UniqueThread member of the CLIENT_ID in the
3437 /// TEB of the thread that asks to terminate the process.
3438 ShutdownThreadId: HANDLE,
3439};
3440
3441pub const RTL_USER_PROCESS_PARAMETERS = extern struct {
3442 AllocationSize: ULONG,
3443 Size: ULONG,
3444 Flags: ULONG,
3445 DebugFlags: ULONG,
3446 ConsoleHandle: HANDLE,
3447 ConsoleFlags: ULONG,
3448 hStdInput: HANDLE,
3449 hStdOutput: HANDLE,
3450 hStdError: HANDLE,
3451 CurrentDirectory: CURDIR,
3452 DllPath: UNICODE_STRING,
3453 ImagePathName: UNICODE_STRING,
3454 CommandLine: UNICODE_STRING,
3455 Environment: [*:0]WCHAR,
3456 dwX: ULONG,
3457 dwY: ULONG,
3458 dwXSize: ULONG,
3459 dwYSize: ULONG,
3460 dwXCountChars: ULONG,
3461 dwYCountChars: ULONG,
3462 dwFillAttribute: ULONG,
3463 dwFlags: ULONG,
3464 dwShowWindow: ULONG,
3465 WindowTitle: UNICODE_STRING,
3466 Desktop: UNICODE_STRING,
3467 ShellInfo: UNICODE_STRING,
3468 RuntimeInfo: UNICODE_STRING,
3469 DLCurrentDirectory: [0x20]RTL_DRIVE_LETTER_CURDIR,
3470};
3471
3472pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
3473 Flags: c_ushort,
3474 Length: c_ushort,
3475 TimeStamp: ULONG,
3476 DosPath: UNICODE_STRING,
3477};
3478
3479pub const PPS_POST_PROCESS_INIT_ROUTINE = ?fn () callconv(.C) void;
3480
3481pub const FILE_BOTH_DIR_INFORMATION = extern struct {
3482 NextEntryOffset: ULONG,
3483 FileIndex: ULONG,
3484 CreationTime: LARGE_INTEGER,
3485 LastAccessTime: LARGE_INTEGER,
3486 LastWriteTime: LARGE_INTEGER,
3487 ChangeTime: LARGE_INTEGER,
3488 EndOfFile: LARGE_INTEGER,
3489 AllocationSize: LARGE_INTEGER,
3490 FileAttributes: ULONG,
3491 FileNameLength: ULONG,
3492 EaSize: ULONG,
3493 ShortNameLength: CHAR,
3494 ShortName: [12]WCHAR,
3495 FileName: [1]WCHAR,
3496};
3497pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION;
3498
3499pub const IO_APC_ROUTINE = fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void;
3500
3501pub const CURDIR = extern struct {
3502 DosPath: UNICODE_STRING,
3503 Handle: HANDLE,
3504};
3505
3506pub const DUPLICATE_SAME_ACCESS = 2;
3507
3508pub const MODULEINFO = extern struct {
3509 lpBaseOfDll: LPVOID,
3510 SizeOfImage: DWORD,
3511 EntryPoint: LPVOID,
3512};
3513
3514pub const PSAPI_WS_WATCH_INFORMATION = extern struct {
3515 FaultingPc: LPVOID,
3516 FaultingVa: LPVOID,
3517};
3518
3519pub const PROCESS_MEMORY_COUNTERS = extern struct {
3520 cb: DWORD,
3521 PageFaultCount: DWORD,
3522 PeakWorkingSetSize: SIZE_T,
3523 WorkingSetSize: SIZE_T,
3524 QuotaPeakPagedPoolUsage: SIZE_T,
3525 QuotaPagedPoolUsage: SIZE_T,
3526 QuotaPeakNonPagedPoolUsage: SIZE_T,
3527 QuotaNonPagedPoolUsage: SIZE_T,
3528 PagefileUsage: SIZE_T,
3529 PeakPagefileUsage: SIZE_T,
3530};
3531
3532pub const PROCESS_MEMORY_COUNTERS_EX = extern struct {
3533 cb: DWORD,
3534 PageFaultCount: DWORD,
3535 PeakWorkingSetSize: SIZE_T,
3536 WorkingSetSize: SIZE_T,
3537 QuotaPeakPagedPoolUsage: SIZE_T,
3538 QuotaPagedPoolUsage: SIZE_T,
3539 QuotaPeakNonPagedPoolUsage: SIZE_T,
3540 QuotaNonPagedPoolUsage: SIZE_T,
3541 PagefileUsage: SIZE_T,
3542 PeakPagefileUsage: SIZE_T,
3543 PrivateUsage: SIZE_T,
3544};
3545
3546pub const PERFORMANCE_INFORMATION = extern struct {
3547 cb: DWORD,
3548 CommitTotal: SIZE_T,
3549 CommitLimit: SIZE_T,
3550 CommitPeak: SIZE_T,
3551 PhysicalTotal: SIZE_T,
3552 PhysicalAvailable: SIZE_T,
3553 SystemCache: SIZE_T,
3554 KernelTotal: SIZE_T,
3555 KernelPaged: SIZE_T,
3556 KernelNonpaged: SIZE_T,
3557 PageSize: SIZE_T,
3558 HandleCount: DWORD,
3559 ProcessCount: DWORD,
3560 ThreadCount: DWORD,
3561};
3562
3563pub const ENUM_PAGE_FILE_INFORMATION = extern struct {
3564 cb: DWORD,
3565 Reserved: DWORD,
3566 TotalSize: SIZE_T,
3567 TotalInUse: SIZE_T,
3568 PeakUsage: SIZE_T,
3569};
3570
3571pub const PENUM_PAGE_FILE_CALLBACKW = ?fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL;
3572pub const PENUM_PAGE_FILE_CALLBACKA = ?fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL;
3573
3574pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {
3575 BasicInfo: PSAPI_WS_WATCH_INFORMATION,
3576 FaultingThreadId: ULONG_PTR,
3577 Flags: ULONG_PTR,
3578};
3579
3580pub const OSVERSIONINFOW = extern struct {
3581 dwOSVersionInfoSize: ULONG,
3582 dwMajorVersion: ULONG,
3583 dwMinorVersion: ULONG,
3584 dwBuildNumber: ULONG,
3585 dwPlatformId: ULONG,
3586 szCSDVersion: [128]WCHAR,
3587};
3588pub const RTL_OSVERSIONINFOW = OSVERSIONINFOW;
3589
3590pub const REPARSE_DATA_BUFFER = extern struct {
3591 ReparseTag: ULONG,
3592 ReparseDataLength: USHORT,
3593 Reserved: USHORT,
3594 DataBuffer: [1]UCHAR,
3595};
3596pub const SYMBOLIC_LINK_REPARSE_BUFFER = extern struct {
3597 SubstituteNameOffset: USHORT,
3598 SubstituteNameLength: USHORT,
3599 PrintNameOffset: USHORT,
3600 PrintNameLength: USHORT,
3601 Flags: ULONG,
3602 PathBuffer: [1]WCHAR,
3603};
3604pub const MOUNT_POINT_REPARSE_BUFFER = extern struct {
3605 SubstituteNameOffset: USHORT,
3606 SubstituteNameLength: USHORT,
3607 PrintNameOffset: USHORT,
3608 PrintNameLength: USHORT,
3609 PathBuffer: [1]WCHAR,
3610};
3611pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: ULONG = 16 * 1024;
3612pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
3613pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
3614pub const IO_REPARSE_TAG_SYMLINK: ULONG = 0xa000000c;
3615pub const IO_REPARSE_TAG_MOUNT_POINT: ULONG = 0xa0000003;
3616pub const SYMLINK_FLAG_RELATIVE: ULONG = 0x1;
3617
3618pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 0x1;
3619pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: DWORD = 0x2;
3620
3621pub const MOUNTMGR_MOUNT_POINT = extern struct {
3622 SymbolicLinkNameOffset: ULONG,
3623 SymbolicLinkNameLength: USHORT,
3624 Reserved1: USHORT,
3625 UniqueIdOffset: ULONG,
3626 UniqueIdLength: USHORT,
3627 Reserved2: USHORT,
3628 DeviceNameOffset: ULONG,
3629 DeviceNameLength: USHORT,
3630 Reserved3: USHORT,
3631};
3632pub const MOUNTMGR_MOUNT_POINTS = extern struct {
3633 Size: ULONG,
3634 NumberOfMountPoints: ULONG,
3635 MountPoints: [1]MOUNTMGR_MOUNT_POINT,
3636};
3637pub const IOCTL_MOUNTMGR_QUERY_POINTS: ULONG = 0x6d0008;
3638
3639pub const OBJECT_INFORMATION_CLASS = enum(c_int) {
3640 ObjectBasicInformation = 0,
3641 ObjectNameInformation = 1,
3642 ObjectTypeInformation = 2,
3643 ObjectTypesInformation = 3,
3644 ObjectHandleFlagInformation = 4,
3645 ObjectSessionInformation = 5,
3646 MaxObjectInfoClass,
3647};
3648
3649pub const OBJECT_NAME_INFORMATION = extern struct {
3650 Name: UNICODE_STRING,
3651};
3652
3653pub const SRWLOCK = usize;
3654pub const SRWLOCK_INIT: SRWLOCK = 0;
3655pub const CONDITION_VARIABLE = usize;
3656pub const CONDITION_VARIABLE_INIT: CONDITION_VARIABLE = 0;
3657
3658pub const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 0x1;
3659pub const FILE_SKIP_SET_EVENT_ON_HANDLE = 0x2;
3660
3661pub const CTRL_C_EVENT: DWORD = 0;
3662pub const CTRL_BREAK_EVENT: DWORD = 1;
3663pub const CTRL_CLOSE_EVENT: DWORD = 2;
3664pub const CTRL_LOGOFF_EVENT: DWORD = 5;
3665pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;
3666
3667pub const HANDLER_ROUTINE = fn (dwCtrlType: DWORD) callconv(.C) BOOL;
lib/std/os/windows/advapi32.zig+15-5
......@@ -1,4 +1,14 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const BOOL = windows.BOOL;
4const DWORD = windows.DWORD;
5const HKEY = windows.HKEY;
6const BYTE = windows.BYTE;
7const LPCWSTR = windows.LPCWSTR;
8const LSTATUS = windows.LSTATUS;
9const REGSAM = windows.REGSAM;
10const ULONG = windows.ULONG;
11const WINAPI = windows.WINAPI;
212
313pub extern "advapi32" fn RegOpenKeyExW(
414 hKey: HKEY,
......@@ -11,10 +21,10 @@ pub extern "advapi32" fn RegOpenKeyExW(
1121pub extern "advapi32" fn RegQueryValueExW(
1222 hKey: HKEY,
1323 lpValueName: LPCWSTR,
14 lpReserved: LPDWORD,
15 lpType: LPDWORD,
16 lpData: LPBYTE,
17 lpcbData: LPDWORD,
24 lpReserved: *DWORD,
25 lpType: *DWORD,
26 lpData: *BYTE,
27 lpcbData: *DWORD,
1828) callconv(WINAPI) LSTATUS;
1929
2030// RtlGenRandom is known as SystemFunction036 under advapi32
lib/std/os/windows/bits.zig deleted-1668
......@@ -1,1668 +0,0 @@
1// Platform-dependent types and values that are used along with OS-specific APIs.
2
3const std = @import("../../std.zig");
4const assert = std.debug.assert;
5const maxInt = std.math.maxInt;
6const arch = std.Target.current.cpu.arch;
7
8pub usingnamespace @import("win32error.zig");
9pub usingnamespace @import("ntstatus.zig");
10pub const LANG = @import("lang.zig");
11pub const SUBLANG = @import("sublang.zig");
12
13/// The standard input device. Initially, this is the console input buffer, CONIN$.
14pub const STD_INPUT_HANDLE = maxInt(DWORD) - 10 + 1;
15
16/// The standard output device. Initially, this is the active console screen buffer, CONOUT$.
17pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;
18
19/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.
20pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;
21
22pub const WINAPI: std.builtin.CallingConvention = if (arch == .i386)
23 .Stdcall
24else
25 .C;
26
27pub const BOOL = c_int;
28pub const BOOLEAN = BYTE;
29pub const BYTE = u8;
30pub const CHAR = u8;
31pub const UCHAR = u8;
32pub const FLOAT = f32;
33pub const HANDLE = *c_void;
34pub const HCRYPTPROV = ULONG_PTR;
35pub const ATOM = u16;
36pub const HBRUSH = *opaque {};
37pub const HCURSOR = *opaque {};
38pub const HICON = *opaque {};
39pub const HINSTANCE = *opaque {};
40pub const HMENU = *opaque {};
41pub const HMODULE = *opaque {};
42pub const HWND = *opaque {};
43pub const HDC = *opaque {};
44pub const HGLRC = *opaque {};
45pub const FARPROC = *opaque {};
46pub const INT = c_int;
47pub const LPBYTE = *BYTE;
48pub const LPCH = *CHAR;
49pub const LPCSTR = [*:0]const CHAR;
50pub const LPCVOID = *const c_void;
51pub const LPDWORD = *DWORD;
52pub const LPSTR = [*:0]CHAR;
53pub const LPVOID = *c_void;
54pub const LPWSTR = [*:0]WCHAR;
55pub const LPCWSTR = [*:0]const WCHAR;
56pub const PVOID = *c_void;
57pub const PWSTR = [*:0]WCHAR;
58pub const SIZE_T = usize;
59pub const UINT = c_uint;
60pub const ULONG_PTR = usize;
61pub const LONG_PTR = isize;
62pub const DWORD_PTR = ULONG_PTR;
63pub const WCHAR = u16;
64pub const WORD = u16;
65pub const DWORD = u32;
66pub const DWORD64 = u64;
67pub const LARGE_INTEGER = i64;
68pub const ULARGE_INTEGER = u64;
69pub const USHORT = u16;
70pub const SHORT = i16;
71pub const ULONG = u32;
72pub const LONG = i32;
73pub const ULONGLONG = u64;
74pub const LONGLONG = i64;
75pub const HLOCAL = HANDLE;
76pub const LANGID = c_ushort;
77
78pub const WPARAM = usize;
79pub const LPARAM = LONG_PTR;
80pub const LRESULT = LONG_PTR;
81
82pub const va_list = *opaque {};
83
84pub const TRUE = 1;
85pub const FALSE = 0;
86
87pub const DEVICE_TYPE = ULONG;
88pub const FILE_DEVICE_BEEP: DEVICE_TYPE = 0x0001;
89pub const FILE_DEVICE_CD_ROM: DEVICE_TYPE = 0x0002;
90pub const FILE_DEVICE_CD_ROM_FILE_SYSTEM: DEVICE_TYPE = 0x0003;
91pub const FILE_DEVICE_CONTROLLER: DEVICE_TYPE = 0x0004;
92pub const FILE_DEVICE_DATALINK: DEVICE_TYPE = 0x0005;
93pub const FILE_DEVICE_DFS: DEVICE_TYPE = 0x0006;
94pub const FILE_DEVICE_DISK: DEVICE_TYPE = 0x0007;
95pub const FILE_DEVICE_DISK_FILE_SYSTEM: DEVICE_TYPE = 0x0008;
96pub const FILE_DEVICE_FILE_SYSTEM: DEVICE_TYPE = 0x0009;
97pub const FILE_DEVICE_INPORT_PORT: DEVICE_TYPE = 0x000a;
98pub const FILE_DEVICE_KEYBOARD: DEVICE_TYPE = 0x000b;
99pub const FILE_DEVICE_MAILSLOT: DEVICE_TYPE = 0x000c;
100pub const FILE_DEVICE_MIDI_IN: DEVICE_TYPE = 0x000d;
101pub const FILE_DEVICE_MIDI_OUT: DEVICE_TYPE = 0x000e;
102pub const FILE_DEVICE_MOUSE: DEVICE_TYPE = 0x000f;
103pub const FILE_DEVICE_MULTI_UNC_PROVIDER: DEVICE_TYPE = 0x0010;
104pub const FILE_DEVICE_NAMED_PIPE: DEVICE_TYPE = 0x0011;
105pub const FILE_DEVICE_NETWORK: DEVICE_TYPE = 0x0012;
106pub const FILE_DEVICE_NETWORK_BROWSER: DEVICE_TYPE = 0x0013;
107pub const FILE_DEVICE_NETWORK_FILE_SYSTEM: DEVICE_TYPE = 0x0014;
108pub const FILE_DEVICE_NULL: DEVICE_TYPE = 0x0015;
109pub const FILE_DEVICE_PARALLEL_PORT: DEVICE_TYPE = 0x0016;
110pub const FILE_DEVICE_PHYSICAL_NETCARD: DEVICE_TYPE = 0x0017;
111pub const FILE_DEVICE_PRINTER: DEVICE_TYPE = 0x0018;
112pub const FILE_DEVICE_SCANNER: DEVICE_TYPE = 0x0019;
113pub const FILE_DEVICE_SERIAL_MOUSE_PORT: DEVICE_TYPE = 0x001a;
114pub const FILE_DEVICE_SERIAL_PORT: DEVICE_TYPE = 0x001b;
115pub const FILE_DEVICE_SCREEN: DEVICE_TYPE = 0x001c;
116pub const FILE_DEVICE_SOUND: DEVICE_TYPE = 0x001d;
117pub const FILE_DEVICE_STREAMS: DEVICE_TYPE = 0x001e;
118pub const FILE_DEVICE_TAPE: DEVICE_TYPE = 0x001f;
119pub const FILE_DEVICE_TAPE_FILE_SYSTEM: DEVICE_TYPE = 0x0020;
120pub const FILE_DEVICE_TRANSPORT: DEVICE_TYPE = 0x0021;
121pub const FILE_DEVICE_UNKNOWN: DEVICE_TYPE = 0x0022;
122pub const FILE_DEVICE_VIDEO: DEVICE_TYPE = 0x0023;
123pub const FILE_DEVICE_VIRTUAL_DISK: DEVICE_TYPE = 0x0024;
124pub const FILE_DEVICE_WAVE_IN: DEVICE_TYPE = 0x0025;
125pub const FILE_DEVICE_WAVE_OUT: DEVICE_TYPE = 0x0026;
126pub const FILE_DEVICE_8042_PORT: DEVICE_TYPE = 0x0027;
127pub const FILE_DEVICE_NETWORK_REDIRECTOR: DEVICE_TYPE = 0x0028;
128pub const FILE_DEVICE_BATTERY: DEVICE_TYPE = 0x0029;
129pub const FILE_DEVICE_BUS_EXTENDER: DEVICE_TYPE = 0x002a;
130pub const FILE_DEVICE_MODEM: DEVICE_TYPE = 0x002b;
131pub const FILE_DEVICE_VDM: DEVICE_TYPE = 0x002c;
132pub const FILE_DEVICE_MASS_STORAGE: DEVICE_TYPE = 0x002d;
133pub const FILE_DEVICE_SMB: DEVICE_TYPE = 0x002e;
134pub const FILE_DEVICE_KS: DEVICE_TYPE = 0x002f;
135pub const FILE_DEVICE_CHANGER: DEVICE_TYPE = 0x0030;
136pub const FILE_DEVICE_SMARTCARD: DEVICE_TYPE = 0x0031;
137pub const FILE_DEVICE_ACPI: DEVICE_TYPE = 0x0032;
138pub const FILE_DEVICE_DVD: DEVICE_TYPE = 0x0033;
139pub const FILE_DEVICE_FULLSCREEN_VIDEO: DEVICE_TYPE = 0x0034;
140pub const FILE_DEVICE_DFS_FILE_SYSTEM: DEVICE_TYPE = 0x0035;
141pub const FILE_DEVICE_DFS_VOLUME: DEVICE_TYPE = 0x0036;
142pub const FILE_DEVICE_SERENUM: DEVICE_TYPE = 0x0037;
143pub const FILE_DEVICE_TERMSRV: DEVICE_TYPE = 0x0038;
144pub const FILE_DEVICE_KSEC: DEVICE_TYPE = 0x0039;
145pub const FILE_DEVICE_FIPS: DEVICE_TYPE = 0x003a;
146pub const FILE_DEVICE_INFINIBAND: DEVICE_TYPE = 0x003b;
147// TODO: missing values?
148pub const FILE_DEVICE_VMBUS: DEVICE_TYPE = 0x003e;
149pub const FILE_DEVICE_CRYPT_PROVIDER: DEVICE_TYPE = 0x003f;
150pub const FILE_DEVICE_WPD: DEVICE_TYPE = 0x0040;
151pub const FILE_DEVICE_BLUETOOTH: DEVICE_TYPE = 0x0041;
152pub const FILE_DEVICE_MT_COMPOSITE: DEVICE_TYPE = 0x0042;
153pub const FILE_DEVICE_MT_TRANSPORT: DEVICE_TYPE = 0x0043;
154pub const FILE_DEVICE_BIOMETRIC: DEVICE_TYPE = 0x0044;
155pub const FILE_DEVICE_PMI: DEVICE_TYPE = 0x0045;
156pub const FILE_DEVICE_EHSTOR: DEVICE_TYPE = 0x0046;
157pub const FILE_DEVICE_DEVAPI: DEVICE_TYPE = 0x0047;
158pub const FILE_DEVICE_GPIO: DEVICE_TYPE = 0x0048;
159pub const FILE_DEVICE_USBEX: DEVICE_TYPE = 0x0049;
160pub const FILE_DEVICE_CONSOLE: DEVICE_TYPE = 0x0050;
161pub const FILE_DEVICE_NFP: DEVICE_TYPE = 0x0051;
162pub const FILE_DEVICE_SYSENV: DEVICE_TYPE = 0x0052;
163pub const FILE_DEVICE_VIRTUAL_BLOCK: DEVICE_TYPE = 0x0053;
164pub const FILE_DEVICE_POINT_OF_SERVICE: DEVICE_TYPE = 0x0054;
165pub const FILE_DEVICE_STORAGE_REPLICATION: DEVICE_TYPE = 0x0055;
166pub const FILE_DEVICE_TRUST_ENV: DEVICE_TYPE = 0x0056;
167pub const FILE_DEVICE_UCM: DEVICE_TYPE = 0x0057;
168pub const FILE_DEVICE_UCMTCPCI: DEVICE_TYPE = 0x0058;
169pub const FILE_DEVICE_PERSISTENT_MEMORY: DEVICE_TYPE = 0x0059;
170pub const FILE_DEVICE_NVDIMM: DEVICE_TYPE = 0x005a;
171pub const FILE_DEVICE_HOLOGRAPHIC: DEVICE_TYPE = 0x005b;
172pub const FILE_DEVICE_SDFXHCI: DEVICE_TYPE = 0x005c;
173
174/// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/buffer-descriptions-for-i-o-control-codes
175pub const TransferType = enum(u2) {
176 METHOD_BUFFERED = 0,
177 METHOD_IN_DIRECT = 1,
178 METHOD_OUT_DIRECT = 2,
179 METHOD_NEITHER = 3,
180};
181
182pub const FILE_ANY_ACCESS = 0;
183pub const FILE_READ_ACCESS = 1;
184pub const FILE_WRITE_ACCESS = 2;
185
186/// https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/defining-i-o-control-codes
187pub fn CTL_CODE(deviceType: u16, function: u12, method: TransferType, access: u2) DWORD {
188 return (@as(DWORD, deviceType) << 16) |
189 (@as(DWORD, access) << 14) |
190 (@as(DWORD, function) << 2) |
191 @enumToInt(method);
192}
193
194pub const INVALID_HANDLE_VALUE = @intToPtr(HANDLE, maxInt(usize));
195
196pub const INVALID_FILE_ATTRIBUTES = @as(DWORD, maxInt(DWORD));
197
198pub const FILE_ALL_INFORMATION = extern struct {
199 BasicInformation: FILE_BASIC_INFORMATION,
200 StandardInformation: FILE_STANDARD_INFORMATION,
201 InternalInformation: FILE_INTERNAL_INFORMATION,
202 EaInformation: FILE_EA_INFORMATION,
203 AccessInformation: FILE_ACCESS_INFORMATION,
204 PositionInformation: FILE_POSITION_INFORMATION,
205 ModeInformation: FILE_MODE_INFORMATION,
206 AlignmentInformation: FILE_ALIGNMENT_INFORMATION,
207 NameInformation: FILE_NAME_INFORMATION,
208};
209
210pub const FILE_BASIC_INFORMATION = extern struct {
211 CreationTime: LARGE_INTEGER,
212 LastAccessTime: LARGE_INTEGER,
213 LastWriteTime: LARGE_INTEGER,
214 ChangeTime: LARGE_INTEGER,
215 FileAttributes: ULONG,
216};
217
218pub const FILE_STANDARD_INFORMATION = extern struct {
219 AllocationSize: LARGE_INTEGER,
220 EndOfFile: LARGE_INTEGER,
221 NumberOfLinks: ULONG,
222 DeletePending: BOOLEAN,
223 Directory: BOOLEAN,
224};
225
226pub const FILE_INTERNAL_INFORMATION = extern struct {
227 IndexNumber: LARGE_INTEGER,
228};
229
230pub const FILE_EA_INFORMATION = extern struct {
231 EaSize: ULONG,
232};
233
234pub const FILE_ACCESS_INFORMATION = extern struct {
235 AccessFlags: ACCESS_MASK,
236};
237
238pub const FILE_POSITION_INFORMATION = extern struct {
239 CurrentByteOffset: LARGE_INTEGER,
240};
241
242pub const FILE_END_OF_FILE_INFORMATION = extern struct {
243 EndOfFile: LARGE_INTEGER,
244};
245
246pub const FILE_MODE_INFORMATION = extern struct {
247 Mode: ULONG,
248};
249
250pub const FILE_ALIGNMENT_INFORMATION = extern struct {
251 AlignmentRequirement: ULONG,
252};
253
254pub const FILE_NAME_INFORMATION = extern struct {
255 FileNameLength: ULONG,
256 FileName: [1]WCHAR,
257};
258
259pub const FILE_RENAME_INFORMATION = extern struct {
260 ReplaceIfExists: BOOLEAN,
261 RootDirectory: ?HANDLE,
262 FileNameLength: ULONG,
263 FileName: [1]WCHAR,
264};
265
266pub const IO_STATUS_BLOCK = extern struct {
267 // "DUMMYUNIONNAME" expands to "u"
268 u: extern union {
269 Status: NTSTATUS,
270 Pointer: ?*c_void,
271 },
272 Information: ULONG_PTR,
273};
274
275pub const FILE_INFORMATION_CLASS = enum(c_int) {
276 FileDirectoryInformation = 1,
277 FileFullDirectoryInformation,
278 FileBothDirectoryInformation,
279 FileBasicInformation,
280 FileStandardInformation,
281 FileInternalInformation,
282 FileEaInformation,
283 FileAccessInformation,
284 FileNameInformation,
285 FileRenameInformation,
286 FileLinkInformation,
287 FileNamesInformation,
288 FileDispositionInformation,
289 FilePositionInformation,
290 FileFullEaInformation,
291 FileModeInformation,
292 FileAlignmentInformation,
293 FileAllInformation,
294 FileAllocationInformation,
295 FileEndOfFileInformation,
296 FileAlternateNameInformation,
297 FileStreamInformation,
298 FilePipeInformation,
299 FilePipeLocalInformation,
300 FilePipeRemoteInformation,
301 FileMailslotQueryInformation,
302 FileMailslotSetInformation,
303 FileCompressionInformation,
304 FileObjectIdInformation,
305 FileCompletionInformation,
306 FileMoveClusterInformation,
307 FileQuotaInformation,
308 FileReparsePointInformation,
309 FileNetworkOpenInformation,
310 FileAttributeTagInformation,
311 FileTrackingInformation,
312 FileIdBothDirectoryInformation,
313 FileIdFullDirectoryInformation,
314 FileValidDataLengthInformation,
315 FileShortNameInformation,
316 FileIoCompletionNotificationInformation,
317 FileIoStatusBlockRangeInformation,
318 FileIoPriorityHintInformation,
319 FileSfioReserveInformation,
320 FileSfioVolumeInformation,
321 FileHardLinkInformation,
322 FileProcessIdsUsingFileInformation,
323 FileNormalizedNameInformation,
324 FileNetworkPhysicalNameInformation,
325 FileIdGlobalTxDirectoryInformation,
326 FileIsRemoteDeviceInformation,
327 FileUnusedInformation,
328 FileNumaNodeInformation,
329 FileStandardLinkInformation,
330 FileRemoteProtocolInformation,
331 FileRenameInformationBypassAccessCheck,
332 FileLinkInformationBypassAccessCheck,
333 FileVolumeNameInformation,
334 FileIdInformation,
335 FileIdExtdDirectoryInformation,
336 FileReplaceCompletionInformation,
337 FileHardLinkFullIdInformation,
338 FileIdExtdBothDirectoryInformation,
339 FileDispositionInformationEx,
340 FileRenameInformationEx,
341 FileRenameInformationExBypassAccessCheck,
342 FileDesiredStorageClassInformation,
343 FileStatInformation,
344 FileMemoryPartitionInformation,
345 FileStatLxInformation,
346 FileCaseSensitiveInformation,
347 FileLinkInformationEx,
348 FileLinkInformationExBypassAccessCheck,
349 FileStorageReserveIdInformation,
350 FileCaseSensitiveInformationForceAccessCheck,
351 FileMaximumInformation,
352};
353
354pub const OVERLAPPED = extern struct {
355 Internal: ULONG_PTR,
356 InternalHigh: ULONG_PTR,
357 DUMMYUNIONNAME: extern union {
358 DUMMYSTRUCTNAME: extern struct {
359 Offset: DWORD,
360 OffsetHigh: DWORD,
361 },
362 Pointer: ?PVOID,
363 },
364 hEvent: ?HANDLE,
365};
366pub const LPOVERLAPPED = *OVERLAPPED;
367
368pub const OVERLAPPED_ENTRY = extern struct {
369 lpCompletionKey: ULONG_PTR,
370 lpOverlapped: LPOVERLAPPED,
371 Internal: ULONG_PTR,
372 dwNumberOfBytesTransferred: DWORD,
373};
374pub const LPOVERLAPPED_ENTRY = *OVERLAPPED_ENTRY;
375
376pub const MAX_PATH = 260;
377
378// TODO issue #305
379pub const FILE_INFO_BY_HANDLE_CLASS = u32;
380pub const FileBasicInfo = 0;
381pub const FileStandardInfo = 1;
382pub const FileNameInfo = 2;
383pub const FileRenameInfo = 3;
384pub const FileDispositionInfo = 4;
385pub const FileAllocationInfo = 5;
386pub const FileEndOfFileInfo = 6;
387pub const FileStreamInfo = 7;
388pub const FileCompressionInfo = 8;
389pub const FileAttributeTagInfo = 9;
390pub const FileIdBothDirectoryInfo = 10;
391pub const FileIdBothDirectoryRestartInfo = 11;
392pub const FileIoPriorityHintInfo = 12;
393pub const FileRemoteProtocolInfo = 13;
394pub const FileFullDirectoryInfo = 14;
395pub const FileFullDirectoryRestartInfo = 15;
396pub const FileStorageInfo = 16;
397pub const FileAlignmentInfo = 17;
398pub const FileIdInfo = 18;
399pub const FileIdExtdDirectoryInfo = 19;
400pub const FileIdExtdDirectoryRestartInfo = 20;
401
402pub const BY_HANDLE_FILE_INFORMATION = extern struct {
403 dwFileAttributes: DWORD,
404 ftCreationTime: FILETIME,
405 ftLastAccessTime: FILETIME,
406 ftLastWriteTime: FILETIME,
407 dwVolumeSerialNumber: DWORD,
408 nFileSizeHigh: DWORD,
409 nFileSizeLow: DWORD,
410 nNumberOfLinks: DWORD,
411 nFileIndexHigh: DWORD,
412 nFileIndexLow: DWORD,
413};
414
415pub const FILE_NAME_INFO = extern struct {
416 FileNameLength: DWORD,
417 FileName: [1]WCHAR,
418};
419
420/// Return the normalized drive name. This is the default.
421pub const FILE_NAME_NORMALIZED = 0x0;
422
423/// Return the opened file name (not normalized).
424pub const FILE_NAME_OPENED = 0x8;
425
426/// Return the path with the drive letter. This is the default.
427pub const VOLUME_NAME_DOS = 0x0;
428
429/// Return the path with a volume GUID path instead of the drive name.
430pub const VOLUME_NAME_GUID = 0x1;
431
432/// Return the path with no drive information.
433pub const VOLUME_NAME_NONE = 0x4;
434
435/// Return the path with the volume device path.
436pub const VOLUME_NAME_NT = 0x2;
437
438pub const SECURITY_ATTRIBUTES = extern struct {
439 nLength: DWORD,
440 lpSecurityDescriptor: ?*c_void,
441 bInheritHandle: BOOL,
442};
443pub const PSECURITY_ATTRIBUTES = *SECURITY_ATTRIBUTES;
444pub const LPSECURITY_ATTRIBUTES = *SECURITY_ATTRIBUTES;
445
446pub const PIPE_ACCESS_INBOUND = 0x00000001;
447pub const PIPE_ACCESS_OUTBOUND = 0x00000002;
448pub const PIPE_ACCESS_DUPLEX = 0x00000003;
449
450pub const PIPE_TYPE_BYTE = 0x00000000;
451pub const PIPE_TYPE_MESSAGE = 0x00000004;
452
453pub const PIPE_READMODE_BYTE = 0x00000000;
454pub const PIPE_READMODE_MESSAGE = 0x00000002;
455
456pub const PIPE_WAIT = 0x00000000;
457pub const PIPE_NOWAIT = 0x00000001;
458
459pub const GENERIC_READ = 0x80000000;
460pub const GENERIC_WRITE = 0x40000000;
461pub const GENERIC_EXECUTE = 0x20000000;
462pub const GENERIC_ALL = 0x10000000;
463
464pub const FILE_SHARE_DELETE = 0x00000004;
465pub const FILE_SHARE_READ = 0x00000001;
466pub const FILE_SHARE_WRITE = 0x00000002;
467
468pub const DELETE = 0x00010000;
469pub const READ_CONTROL = 0x00020000;
470pub const WRITE_DAC = 0x00040000;
471pub const WRITE_OWNER = 0x00080000;
472pub const SYNCHRONIZE = 0x00100000;
473pub const STANDARD_RIGHTS_READ = READ_CONTROL;
474pub const STANDARD_RIGHTS_WRITE = READ_CONTROL;
475pub const STANDARD_RIGHTS_EXECUTE = READ_CONTROL;
476pub const STANDARD_RIGHTS_REQUIRED = DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER;
477
478// disposition for NtCreateFile
479pub const FILE_SUPERSEDE = 0;
480pub const FILE_OPEN = 1;
481pub const FILE_CREATE = 2;
482pub const FILE_OPEN_IF = 3;
483pub const FILE_OVERWRITE = 4;
484pub const FILE_OVERWRITE_IF = 5;
485pub const FILE_MAXIMUM_DISPOSITION = 5;
486
487// flags for NtCreateFile and NtOpenFile
488pub const FILE_READ_DATA = 0x00000001;
489pub const FILE_LIST_DIRECTORY = 0x00000001;
490pub const FILE_WRITE_DATA = 0x00000002;
491pub const FILE_ADD_FILE = 0x00000002;
492pub const FILE_APPEND_DATA = 0x00000004;
493pub const FILE_ADD_SUBDIRECTORY = 0x00000004;
494pub const FILE_CREATE_PIPE_INSTANCE = 0x00000004;
495pub const FILE_READ_EA = 0x00000008;
496pub const FILE_WRITE_EA = 0x00000010;
497pub const FILE_EXECUTE = 0x00000020;
498pub const FILE_TRAVERSE = 0x00000020;
499pub const FILE_DELETE_CHILD = 0x00000040;
500pub const FILE_READ_ATTRIBUTES = 0x00000080;
501pub const FILE_WRITE_ATTRIBUTES = 0x00000100;
502
503pub const FILE_DIRECTORY_FILE = 0x00000001;
504pub const FILE_WRITE_THROUGH = 0x00000002;
505pub const FILE_SEQUENTIAL_ONLY = 0x00000004;
506pub const FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008;
507pub const FILE_SYNCHRONOUS_IO_ALERT = 0x00000010;
508pub const FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020;
509pub const FILE_NON_DIRECTORY_FILE = 0x00000040;
510pub const FILE_CREATE_TREE_CONNECTION = 0x00000080;
511pub const FILE_COMPLETE_IF_OPLOCKED = 0x00000100;
512pub const FILE_NO_EA_KNOWLEDGE = 0x00000200;
513pub const FILE_OPEN_FOR_RECOVERY = 0x00000400;
514pub const FILE_RANDOM_ACCESS = 0x00000800;
515pub const FILE_DELETE_ON_CLOSE = 0x00001000;
516pub const FILE_OPEN_BY_FILE_ID = 0x00002000;
517pub const FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000;
518pub const FILE_NO_COMPRESSION = 0x00008000;
519pub const FILE_RESERVE_OPFILTER = 0x00100000;
520pub const FILE_OPEN_REPARSE_POINT = 0x00200000;
521pub const FILE_OPEN_OFFLINE_FILE = 0x00400000;
522pub const FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000;
523
524pub const CREATE_ALWAYS = 2;
525pub const CREATE_NEW = 1;
526pub const OPEN_ALWAYS = 4;
527pub const OPEN_EXISTING = 3;
528pub const TRUNCATE_EXISTING = 5;
529
530pub const FILE_ATTRIBUTE_ARCHIVE = 0x20;
531pub const FILE_ATTRIBUTE_COMPRESSED = 0x800;
532pub const FILE_ATTRIBUTE_DEVICE = 0x40;
533pub const FILE_ATTRIBUTE_DIRECTORY = 0x10;
534pub const FILE_ATTRIBUTE_ENCRYPTED = 0x4000;
535pub const FILE_ATTRIBUTE_HIDDEN = 0x2;
536pub const FILE_ATTRIBUTE_INTEGRITY_STREAM = 0x8000;
537pub const FILE_ATTRIBUTE_NORMAL = 0x80;
538pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x2000;
539pub const FILE_ATTRIBUTE_NO_SCRUB_DATA = 0x20000;
540pub const FILE_ATTRIBUTE_OFFLINE = 0x1000;
541pub const FILE_ATTRIBUTE_READONLY = 0x1;
542pub const FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x400000;
543pub const FILE_ATTRIBUTE_RECALL_ON_OPEN = 0x40000;
544pub const FILE_ATTRIBUTE_REPARSE_POINT = 0x400;
545pub const FILE_ATTRIBUTE_SPARSE_FILE = 0x200;
546pub const FILE_ATTRIBUTE_SYSTEM = 0x4;
547pub const FILE_ATTRIBUTE_TEMPORARY = 0x100;
548pub const FILE_ATTRIBUTE_VIRTUAL = 0x10000;
549
550// flags for CreateEvent
551pub const CREATE_EVENT_INITIAL_SET = 0x00000002;
552pub const CREATE_EVENT_MANUAL_RESET = 0x00000001;
553
554pub const EVENT_ALL_ACCESS = 0x1F0003;
555pub const EVENT_MODIFY_STATE = 0x0002;
556
557pub const PROCESS_INFORMATION = extern struct {
558 hProcess: HANDLE,
559 hThread: HANDLE,
560 dwProcessId: DWORD,
561 dwThreadId: DWORD,
562};
563
564pub const STARTUPINFOW = extern struct {
565 cb: DWORD,
566 lpReserved: ?LPWSTR,
567 lpDesktop: ?LPWSTR,
568 lpTitle: ?LPWSTR,
569 dwX: DWORD,
570 dwY: DWORD,
571 dwXSize: DWORD,
572 dwYSize: DWORD,
573 dwXCountChars: DWORD,
574 dwYCountChars: DWORD,
575 dwFillAttribute: DWORD,
576 dwFlags: DWORD,
577 wShowWindow: WORD,
578 cbReserved2: WORD,
579 lpReserved2: ?LPBYTE,
580 hStdInput: ?HANDLE,
581 hStdOutput: ?HANDLE,
582 hStdError: ?HANDLE,
583};
584
585pub const STARTF_FORCEONFEEDBACK = 0x00000040;
586pub const STARTF_FORCEOFFFEEDBACK = 0x00000080;
587pub const STARTF_PREVENTPINNING = 0x00002000;
588pub const STARTF_RUNFULLSCREEN = 0x00000020;
589pub const STARTF_TITLEISAPPID = 0x00001000;
590pub const STARTF_TITLEISLINKNAME = 0x00000800;
591pub const STARTF_UNTRUSTEDSOURCE = 0x00008000;
592pub const STARTF_USECOUNTCHARS = 0x00000008;
593pub const STARTF_USEFILLATTRIBUTE = 0x00000010;
594pub const STARTF_USEHOTKEY = 0x00000200;
595pub const STARTF_USEPOSITION = 0x00000004;
596pub const STARTF_USESHOWWINDOW = 0x00000001;
597pub const STARTF_USESIZE = 0x00000002;
598pub const STARTF_USESTDHANDLES = 0x00000100;
599
600pub const INFINITE = 4294967295;
601
602pub const MAXIMUM_WAIT_OBJECTS = 64;
603
604pub const WAIT_ABANDONED = 0x00000080;
605pub const WAIT_ABANDONED_0 = WAIT_ABANDONED + 0;
606pub const WAIT_OBJECT_0 = 0x00000000;
607pub const WAIT_TIMEOUT = 0x00000102;
608pub const WAIT_FAILED = 0xFFFFFFFF;
609
610pub const HANDLE_FLAG_INHERIT = 0x00000001;
611pub const HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x00000002;
612
613pub const MOVEFILE_COPY_ALLOWED = 2;
614pub const MOVEFILE_CREATE_HARDLINK = 16;
615pub const MOVEFILE_DELAY_UNTIL_REBOOT = 4;
616pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE = 32;
617pub const MOVEFILE_REPLACE_EXISTING = 1;
618pub const MOVEFILE_WRITE_THROUGH = 8;
619
620pub const FILE_BEGIN = 0;
621pub const FILE_CURRENT = 1;
622pub const FILE_END = 2;
623
624pub const HEAP_CREATE_ENABLE_EXECUTE = 0x00040000;
625pub const HEAP_REALLOC_IN_PLACE_ONLY = 0x00000010;
626pub const HEAP_GENERATE_EXCEPTIONS = 0x00000004;
627pub const HEAP_NO_SERIALIZE = 0x00000001;
628
629// AllocationType values
630pub const MEM_COMMIT = 0x1000;
631pub const MEM_RESERVE = 0x2000;
632pub const MEM_RESET = 0x80000;
633pub const MEM_RESET_UNDO = 0x1000000;
634pub const MEM_LARGE_PAGES = 0x20000000;
635pub const MEM_PHYSICAL = 0x400000;
636pub const MEM_TOP_DOWN = 0x100000;
637pub const MEM_WRITE_WATCH = 0x200000;
638
639// Protect values
640pub const PAGE_EXECUTE = 0x10;
641pub const PAGE_EXECUTE_READ = 0x20;
642pub const PAGE_EXECUTE_READWRITE = 0x40;
643pub const PAGE_EXECUTE_WRITECOPY = 0x80;
644pub const PAGE_NOACCESS = 0x01;
645pub const PAGE_READONLY = 0x02;
646pub const PAGE_READWRITE = 0x04;
647pub const PAGE_WRITECOPY = 0x08;
648pub const PAGE_TARGETS_INVALID = 0x40000000;
649pub const PAGE_TARGETS_NO_UPDATE = 0x40000000; // Same as PAGE_TARGETS_INVALID
650pub const PAGE_GUARD = 0x100;
651pub const PAGE_NOCACHE = 0x200;
652pub const PAGE_WRITECOMBINE = 0x400;
653
654// FreeType values
655pub const MEM_COALESCE_PLACEHOLDERS = 0x1;
656pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
657pub const MEM_DECOMMIT = 0x4000;
658pub const MEM_RELEASE = 0x8000;
659
660pub const PTHREAD_START_ROUTINE = fn (LPVOID) callconv(.C) DWORD;
661pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
662
663pub const WIN32_FIND_DATAW = extern struct {
664 dwFileAttributes: DWORD,
665 ftCreationTime: FILETIME,
666 ftLastAccessTime: FILETIME,
667 ftLastWriteTime: FILETIME,
668 nFileSizeHigh: DWORD,
669 nFileSizeLow: DWORD,
670 dwReserved0: DWORD,
671 dwReserved1: DWORD,
672 cFileName: [260]u16,
673 cAlternateFileName: [14]u16,
674};
675
676pub const FILETIME = extern struct {
677 dwLowDateTime: DWORD,
678 dwHighDateTime: DWORD,
679};
680
681pub const SYSTEM_INFO = extern struct {
682 anon1: extern union {
683 dwOemId: DWORD,
684 anon2: extern struct {
685 wProcessorArchitecture: WORD,
686 wReserved: WORD,
687 },
688 },
689 dwPageSize: DWORD,
690 lpMinimumApplicationAddress: LPVOID,
691 lpMaximumApplicationAddress: LPVOID,
692 dwActiveProcessorMask: DWORD_PTR,
693 dwNumberOfProcessors: DWORD,
694 dwProcessorType: DWORD,
695 dwAllocationGranularity: DWORD,
696 wProcessorLevel: WORD,
697 wProcessorRevision: WORD,
698};
699
700pub const HRESULT = c_long;
701
702pub const KNOWNFOLDERID = GUID;
703pub const GUID = extern struct {
704 Data1: c_ulong,
705 Data2: c_ushort,
706 Data3: c_ushort,
707 Data4: [8]u8,
708
709 pub fn parse(str: []const u8) GUID {
710 var guid: GUID = undefined;
711 var index: usize = 0;
712 assert(str[index] == '{');
713 index += 1;
714
715 guid.Data1 = std.fmt.parseUnsigned(c_ulong, str[index .. index + 8], 16) catch unreachable;
716 index += 8;
717
718 assert(str[index] == '-');
719 index += 1;
720
721 guid.Data2 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
722 index += 4;
723
724 assert(str[index] == '-');
725 index += 1;
726
727 guid.Data3 = std.fmt.parseUnsigned(c_ushort, str[index .. index + 4], 16) catch unreachable;
728 index += 4;
729
730 assert(str[index] == '-');
731 index += 1;
732
733 guid.Data4[0] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
734 index += 2;
735 guid.Data4[1] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
736 index += 2;
737
738 assert(str[index] == '-');
739 index += 1;
740
741 var i: usize = 2;
742 while (i < guid.Data4.len) : (i += 1) {
743 guid.Data4[i] = std.fmt.parseUnsigned(u8, str[index .. index + 2], 16) catch unreachable;
744 index += 2;
745 }
746
747 assert(str[index] == '}');
748 index += 1;
749 return guid;
750 }
751};
752
753pub const FOLDERID_LocalAppData = GUID.parse("{F1B32785-6FBA-4FCF-9D55-7B8E7F157091}");
754
755pub const KF_FLAG_DEFAULT = 0;
756pub const KF_FLAG_NO_APPCONTAINER_REDIRECTION = 65536;
757pub const KF_FLAG_CREATE = 32768;
758pub const KF_FLAG_DONT_VERIFY = 16384;
759pub const KF_FLAG_DONT_UNEXPAND = 8192;
760pub const KF_FLAG_NO_ALIAS = 4096;
761pub const KF_FLAG_INIT = 2048;
762pub const KF_FLAG_DEFAULT_PATH = 1024;
763pub const KF_FLAG_NOT_PARENT_RELATIVE = 512;
764pub const KF_FLAG_SIMPLE_IDLIST = 256;
765pub const KF_FLAG_ALIAS_ONLY = -2147483648;
766
767pub const S_OK = 0;
768pub const E_NOTIMPL = @bitCast(c_long, @as(c_ulong, 0x80004001));
769pub const E_NOINTERFACE = @bitCast(c_long, @as(c_ulong, 0x80004002));
770pub const E_POINTER = @bitCast(c_long, @as(c_ulong, 0x80004003));
771pub const E_ABORT = @bitCast(c_long, @as(c_ulong, 0x80004004));
772pub const E_FAIL = @bitCast(c_long, @as(c_ulong, 0x80004005));
773pub const E_UNEXPECTED = @bitCast(c_long, @as(c_ulong, 0x8000FFFF));
774pub const E_ACCESSDENIED = @bitCast(c_long, @as(c_ulong, 0x80070005));
775pub const E_HANDLE = @bitCast(c_long, @as(c_ulong, 0x80070006));
776pub const E_OUTOFMEMORY = @bitCast(c_long, @as(c_ulong, 0x8007000E));
777pub const E_INVALIDARG = @bitCast(c_long, @as(c_ulong, 0x80070057));
778
779pub const FILE_FLAG_BACKUP_SEMANTICS = 0x02000000;
780pub const FILE_FLAG_DELETE_ON_CLOSE = 0x04000000;
781pub const FILE_FLAG_NO_BUFFERING = 0x20000000;
782pub const FILE_FLAG_OPEN_NO_RECALL = 0x00100000;
783pub const FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000;
784pub const FILE_FLAG_OVERLAPPED = 0x40000000;
785pub const FILE_FLAG_POSIX_SEMANTICS = 0x0100000;
786pub const FILE_FLAG_RANDOM_ACCESS = 0x10000000;
787pub const FILE_FLAG_SESSION_AWARE = 0x00800000;
788pub const FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000;
789pub const FILE_FLAG_WRITE_THROUGH = 0x80000000;
790
791pub const RECT = extern struct {
792 left: LONG,
793 top: LONG,
794 right: LONG,
795 bottom: LONG,
796};
797
798pub const SMALL_RECT = extern struct {
799 Left: SHORT,
800 Top: SHORT,
801 Right: SHORT,
802 Bottom: SHORT,
803};
804
805pub const POINT = extern struct {
806 x: LONG,
807 y: LONG,
808};
809
810pub const COORD = extern struct {
811 X: SHORT,
812 Y: SHORT,
813};
814
815pub const CREATE_UNICODE_ENVIRONMENT = 1024;
816
817pub const TLS_OUT_OF_INDEXES = 4294967295;
818pub const IMAGE_TLS_DIRECTORY = extern struct {
819 StartAddressOfRawData: usize,
820 EndAddressOfRawData: usize,
821 AddressOfIndex: usize,
822 AddressOfCallBacks: usize,
823 SizeOfZeroFill: u32,
824 Characteristics: u32,
825};
826pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
827pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;
828
829pub const PIMAGE_TLS_CALLBACK = ?fn (PVOID, DWORD, PVOID) callconv(.C) void;
830
831pub const PROV_RSA_FULL = 1;
832
833pub const REGSAM = ACCESS_MASK;
834pub const ACCESS_MASK = DWORD;
835pub const PHKEY = *HKEY;
836pub const HKEY = *HKEY__;
837pub const HKEY__ = extern struct {
838 unused: c_int,
839};
840pub const LSTATUS = LONG;
841
842pub const FILE_NOTIFY_INFORMATION = extern struct {
843 NextEntryOffset: DWORD,
844 Action: DWORD,
845 FileNameLength: DWORD,
846 // Flexible array member
847 // FileName: [1]WCHAR,
848};
849
850pub const FILE_ACTION_ADDED = 0x00000001;
851pub const FILE_ACTION_REMOVED = 0x00000002;
852pub const FILE_ACTION_MODIFIED = 0x00000003;
853pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
854pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
855
856pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void;
857
858pub const FILE_NOTIFY_CHANGE_CREATION = 64;
859pub const FILE_NOTIFY_CHANGE_SIZE = 8;
860pub const FILE_NOTIFY_CHANGE_SECURITY = 256;
861pub const FILE_NOTIFY_CHANGE_LAST_ACCESS = 32;
862pub const FILE_NOTIFY_CHANGE_LAST_WRITE = 16;
863pub const FILE_NOTIFY_CHANGE_DIR_NAME = 2;
864pub const FILE_NOTIFY_CHANGE_FILE_NAME = 1;
865pub const FILE_NOTIFY_CHANGE_ATTRIBUTES = 4;
866
867pub const CONSOLE_SCREEN_BUFFER_INFO = extern struct {
868 dwSize: COORD,
869 dwCursorPosition: COORD,
870 wAttributes: WORD,
871 srWindow: SMALL_RECT,
872 dwMaximumWindowSize: COORD,
873};
874
875pub const FOREGROUND_BLUE = 1;
876pub const FOREGROUND_GREEN = 2;
877pub const FOREGROUND_RED = 4;
878pub const FOREGROUND_INTENSITY = 8;
879
880pub const LIST_ENTRY = extern struct {
881 Flink: *LIST_ENTRY,
882 Blink: *LIST_ENTRY,
883};
884
885pub const RTL_CRITICAL_SECTION_DEBUG = extern struct {
886 Type: WORD,
887 CreatorBackTraceIndex: WORD,
888 CriticalSection: *RTL_CRITICAL_SECTION,
889 ProcessLocksList: LIST_ENTRY,
890 EntryCount: DWORD,
891 ContentionCount: DWORD,
892 Flags: DWORD,
893 CreatorBackTraceIndexHigh: WORD,
894 SpareWORD: WORD,
895};
896
897pub const RTL_CRITICAL_SECTION = extern struct {
898 DebugInfo: *RTL_CRITICAL_SECTION_DEBUG,
899 LockCount: LONG,
900 RecursionCount: LONG,
901 OwningThread: HANDLE,
902 LockSemaphore: HANDLE,
903 SpinCount: ULONG_PTR,
904};
905
906pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
907pub const INIT_ONCE = RTL_RUN_ONCE;
908pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;
909pub const INIT_ONCE_FN = fn (InitOnce: *INIT_ONCE, Parameter: ?*c_void, Context: ?*c_void) callconv(.C) BOOL;
910
911pub const RTL_RUN_ONCE = extern struct {
912 Ptr: ?*c_void,
913};
914
915pub const RTL_RUN_ONCE_INIT = RTL_RUN_ONCE{ .Ptr = null };
916
917pub const COINIT_APARTMENTTHREADED = COINIT.COINIT_APARTMENTTHREADED;
918pub const COINIT_MULTITHREADED = COINIT.COINIT_MULTITHREADED;
919pub const COINIT_DISABLE_OLE1DDE = COINIT.COINIT_DISABLE_OLE1DDE;
920pub const COINIT_SPEED_OVER_MEMORY = COINIT.COINIT_SPEED_OVER_MEMORY;
921pub const COINIT = enum(c_int) {
922 COINIT_APARTMENTTHREADED = 2,
923 COINIT_MULTITHREADED = 0,
924 COINIT_DISABLE_OLE1DDE = 4,
925 COINIT_SPEED_OVER_MEMORY = 8,
926};
927
928/// > The maximum path of 32,767 characters is approximate, because the "\\?\"
929/// > prefix may be expanded to a longer string by the system at run time, and
930/// > this expansion applies to the total length.
931/// from https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation
932pub const PATH_MAX_WIDE = 32767;
933
934pub const FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
935pub const FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
936pub const FORMAT_MESSAGE_FROM_HMODULE = 0x00000800;
937pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400;
938pub const FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
939pub const FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
940pub const FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF;
941
942pub const EXCEPTION_DATATYPE_MISALIGNMENT = 0x80000002;
943pub const EXCEPTION_ACCESS_VIOLATION = 0xc0000005;
944pub const EXCEPTION_ILLEGAL_INSTRUCTION = 0xc000001d;
945pub const EXCEPTION_STACK_OVERFLOW = 0xc00000fd;
946pub const EXCEPTION_CONTINUE_SEARCH = 0;
947
948pub const EXCEPTION_RECORD = extern struct {
949 ExceptionCode: u32,
950 ExceptionFlags: u32,
951 ExceptionRecord: *EXCEPTION_RECORD,
952 ExceptionAddress: *c_void,
953 NumberParameters: u32,
954 ExceptionInformation: [15]usize,
955};
956
957pub usingnamespace switch (arch) {
958 .i386 => struct {
959 pub const FLOATING_SAVE_AREA = extern struct {
960 ControlWord: DWORD,
961 StatusWord: DWORD,
962 TagWord: DWORD,
963 ErrorOffset: DWORD,
964 ErrorSelector: DWORD,
965 DataOffset: DWORD,
966 DataSelector: DWORD,
967 RegisterArea: [80]BYTE,
968 Cr0NpxState: DWORD,
969 };
970
971 pub const CONTEXT = extern struct {
972 ContextFlags: DWORD,
973 Dr0: DWORD,
974 Dr1: DWORD,
975 Dr2: DWORD,
976 Dr3: DWORD,
977 Dr6: DWORD,
978 Dr7: DWORD,
979 FloatSave: FLOATING_SAVE_AREA,
980 SegGs: DWORD,
981 SegFs: DWORD,
982 SegEs: DWORD,
983 SegDs: DWORD,
984 Edi: DWORD,
985 Esi: DWORD,
986 Ebx: DWORD,
987 Edx: DWORD,
988 Ecx: DWORD,
989 Eax: DWORD,
990 Ebp: DWORD,
991 Eip: DWORD,
992 SegCs: DWORD,
993 EFlags: DWORD,
994 Esp: DWORD,
995 SegSs: DWORD,
996 ExtendedRegisters: [512]BYTE,
997
998 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
999 return .{ .bp = ctx.Ebp, .ip = ctx.Eip };
1000 }
1001 };
1002
1003 pub const PCONTEXT = *CONTEXT;
1004 },
1005 .x86_64 => struct {
1006 pub const M128A = extern struct {
1007 Low: ULONGLONG,
1008 High: LONGLONG,
1009 };
1010
1011 pub const XMM_SAVE_AREA32 = extern struct {
1012 ControlWord: WORD,
1013 StatusWord: WORD,
1014 TagWord: BYTE,
1015 Reserved1: BYTE,
1016 ErrorOpcode: WORD,
1017 ErrorOffset: DWORD,
1018 ErrorSelector: WORD,
1019 Reserved2: WORD,
1020 DataOffset: DWORD,
1021 DataSelector: WORD,
1022 Reserved3: WORD,
1023 MxCsr: DWORD,
1024 MxCsr_Mask: DWORD,
1025 FloatRegisters: [8]M128A,
1026 XmmRegisters: [16]M128A,
1027 Reserved4: [96]BYTE,
1028 };
1029
1030 pub const CONTEXT = extern struct {
1031 P1Home: DWORD64,
1032 P2Home: DWORD64,
1033 P3Home: DWORD64,
1034 P4Home: DWORD64,
1035 P5Home: DWORD64,
1036 P6Home: DWORD64,
1037 ContextFlags: DWORD,
1038 MxCsr: DWORD,
1039 SegCs: WORD,
1040 SegDs: WORD,
1041 SegEs: WORD,
1042 SegFs: WORD,
1043 SegGs: WORD,
1044 SegSs: WORD,
1045 EFlags: DWORD,
1046 Dr0: DWORD64,
1047 Dr1: DWORD64,
1048 Dr2: DWORD64,
1049 Dr3: DWORD64,
1050 Dr6: DWORD64,
1051 Dr7: DWORD64,
1052 Rax: DWORD64,
1053 Rcx: DWORD64,
1054 Rdx: DWORD64,
1055 Rbx: DWORD64,
1056 Rsp: DWORD64,
1057 Rbp: DWORD64,
1058 Rsi: DWORD64,
1059 Rdi: DWORD64,
1060 R8: DWORD64,
1061 R9: DWORD64,
1062 R10: DWORD64,
1063 R11: DWORD64,
1064 R12: DWORD64,
1065 R13: DWORD64,
1066 R14: DWORD64,
1067 R15: DWORD64,
1068 Rip: DWORD64,
1069 DUMMYUNIONNAME: extern union {
1070 FltSave: XMM_SAVE_AREA32,
1071 FloatSave: XMM_SAVE_AREA32,
1072 DUMMYSTRUCTNAME: extern struct {
1073 Header: [2]M128A,
1074 Legacy: [8]M128A,
1075 Xmm0: M128A,
1076 Xmm1: M128A,
1077 Xmm2: M128A,
1078 Xmm3: M128A,
1079 Xmm4: M128A,
1080 Xmm5: M128A,
1081 Xmm6: M128A,
1082 Xmm7: M128A,
1083 Xmm8: M128A,
1084 Xmm9: M128A,
1085 Xmm10: M128A,
1086 Xmm11: M128A,
1087 Xmm12: M128A,
1088 Xmm13: M128A,
1089 Xmm14: M128A,
1090 Xmm15: M128A,
1091 },
1092 },
1093 VectorRegister: [26]M128A,
1094 VectorControl: DWORD64,
1095 DebugControl: DWORD64,
1096 LastBranchToRip: DWORD64,
1097 LastBranchFromRip: DWORD64,
1098 LastExceptionToRip: DWORD64,
1099 LastExceptionFromRip: DWORD64,
1100
1101 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
1102 return .{ .bp = ctx.Rbp, .ip = ctx.Rip };
1103 }
1104 };
1105
1106 pub const PCONTEXT = *CONTEXT;
1107 },
1108 .aarch64 => struct {
1109 pub const NEON128 = extern union {
1110 DUMMYSTRUCTNAME: extern struct {
1111 Low: ULONGLONG,
1112 High: LONGLONG,
1113 },
1114 D: [2]f64,
1115 S: [4]f32,
1116 H: [8]WORD,
1117 B: [16]BYTE,
1118 };
1119
1120 pub const CONTEXT = extern struct {
1121 ContextFlags: ULONG,
1122 Cpsr: ULONG,
1123 DUMMYUNIONNAME: extern union {
1124 DUMMYSTRUCTNAME: extern struct {
1125 X0: DWORD64,
1126 X1: DWORD64,
1127 X2: DWORD64,
1128 X3: DWORD64,
1129 X4: DWORD64,
1130 X5: DWORD64,
1131 X6: DWORD64,
1132 X7: DWORD64,
1133 X8: DWORD64,
1134 X9: DWORD64,
1135 X10: DWORD64,
1136 X11: DWORD64,
1137 X12: DWORD64,
1138 X13: DWORD64,
1139 X14: DWORD64,
1140 X15: DWORD64,
1141 X16: DWORD64,
1142 X17: DWORD64,
1143 X18: DWORD64,
1144 X19: DWORD64,
1145 X20: DWORD64,
1146 X21: DWORD64,
1147 X22: DWORD64,
1148 X23: DWORD64,
1149 X24: DWORD64,
1150 X25: DWORD64,
1151 X26: DWORD64,
1152 X27: DWORD64,
1153 X28: DWORD64,
1154 Fp: DWORD64,
1155 Lr: DWORD64,
1156 },
1157 X: [31]DWORD64,
1158 },
1159 Sp: DWORD64,
1160 Pc: DWORD64,
1161 V: [32]NEON128,
1162 Fpcr: DWORD,
1163 Fpsr: DWORD,
1164 Bcr: [8]DWORD,
1165 Bvr: [8]DWORD64,
1166 Wcr: [2]DWORD,
1167 Wvr: [2]DWORD64,
1168
1169 pub fn getRegs(ctx: *const CONTEXT) struct { bp: usize, ip: usize } {
1170 return .{
1171 .bp = ctx.DUMMYUNIONNAME.DUMMYSTRUCTNAME.Fp,
1172 .ip = ctx.Pc,
1173 };
1174 }
1175 };
1176
1177 pub const PCONTEXT = *CONTEXT;
1178 },
1179 else => struct {
1180 pub const PCONTEXT = *c_void;
1181 },
1182};
1183
1184pub const EXCEPTION_POINTERS = extern struct {
1185 ExceptionRecord: *EXCEPTION_RECORD,
1186 ContextRecord: PCONTEXT,
1187};
1188
1189pub const VECTORED_EXCEPTION_HANDLER = fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long;
1190
1191pub const OBJECT_ATTRIBUTES = extern struct {
1192 Length: ULONG,
1193 RootDirectory: ?HANDLE,
1194 ObjectName: *UNICODE_STRING,
1195 Attributes: ULONG,
1196 SecurityDescriptor: ?*c_void,
1197 SecurityQualityOfService: ?*c_void,
1198};
1199
1200pub const OBJ_INHERIT = 0x00000002;
1201pub const OBJ_PERMANENT = 0x00000010;
1202pub const OBJ_EXCLUSIVE = 0x00000020;
1203pub const OBJ_CASE_INSENSITIVE = 0x00000040;
1204pub const OBJ_OPENIF = 0x00000080;
1205pub const OBJ_OPENLINK = 0x00000100;
1206pub const OBJ_KERNEL_HANDLE = 0x00000200;
1207pub const OBJ_VALID_ATTRIBUTES = 0x000003F2;
1208
1209pub const UNICODE_STRING = extern struct {
1210 Length: c_ushort,
1211 MaximumLength: c_ushort,
1212 Buffer: [*]WCHAR,
1213};
1214
1215const ACTIVATION_CONTEXT_DATA = opaque {};
1216const ASSEMBLY_STORAGE_MAP = opaque {};
1217const FLS_CALLBACK_INFO = opaque {};
1218const RTL_BITMAP = opaque {};
1219pub const PRTL_BITMAP = *RTL_BITMAP;
1220const KAFFINITY = usize;
1221
1222pub const TEB = extern struct {
1223 Reserved1: [12]PVOID,
1224 ProcessEnvironmentBlock: *PEB,
1225 Reserved2: [399]PVOID,
1226 Reserved3: [1952]u8,
1227 TlsSlots: [64]PVOID,
1228 Reserved4: [8]u8,
1229 Reserved5: [26]PVOID,
1230 ReservedForOle: PVOID,
1231 Reserved6: [4]PVOID,
1232 TlsExpansionSlots: PVOID,
1233};
1234
1235/// Process Environment Block
1236/// Microsoft documentation of this is incomplete, the fields here are taken from various resources including:
1237/// - https://github.com/wine-mirror/wine/blob/1aff1e6a370ee8c0213a0fd4b220d121da8527aa/include/winternl.h#L269
1238/// - https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/index.htm
1239pub const PEB = extern struct {
1240 // Versions: All
1241 InheritedAddressSpace: BOOLEAN,
1242
1243 // Versions: 3.51+
1244 ReadImageFileExecOptions: BOOLEAN,
1245 BeingDebugged: BOOLEAN,
1246
1247 // Versions: 5.2+ (previously was padding)
1248 BitField: UCHAR,
1249
1250 // Versions: all
1251 Mutant: HANDLE,
1252 ImageBaseAddress: HMODULE,
1253 Ldr: *PEB_LDR_DATA,
1254 ProcessParameters: *RTL_USER_PROCESS_PARAMETERS,
1255 SubSystemData: PVOID,
1256 ProcessHeap: HANDLE,
1257
1258 // Versions: 5.1+
1259 FastPebLock: *RTL_CRITICAL_SECTION,
1260
1261 // Versions: 5.2+
1262 AtlThunkSListPtr: PVOID,
1263 IFEOKey: PVOID,
1264
1265 // Versions: 6.0+
1266
1267 /// https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/crossprocessflags.htm
1268 CrossProcessFlags: ULONG,
1269
1270 // Versions: 6.0+
1271 union1: extern union {
1272 KernelCallbackTable: PVOID,
1273 UserSharedInfoPtr: PVOID,
1274 },
1275
1276 // Versions: 5.1+
1277 SystemReserved: ULONG,
1278
1279 // Versions: 5.1, (not 5.2, not 6.0), 6.1+
1280 AtlThunkSListPtr32: ULONG,
1281
1282 // Versions: 6.1+
1283 ApiSetMap: PVOID,
1284
1285 // Versions: all
1286 TlsExpansionCounter: ULONG,
1287 // note: there is padding here on 64 bit
1288 TlsBitmap: PRTL_BITMAP,
1289 TlsBitmapBits: [2]ULONG,
1290 ReadOnlySharedMemoryBase: PVOID,
1291
1292 // Versions: 1703+
1293 SharedData: PVOID,
1294
1295 // Versions: all
1296 ReadOnlyStaticServerData: *PVOID,
1297 AnsiCodePageData: PVOID,
1298 OemCodePageData: PVOID,
1299 UnicodeCaseTableData: PVOID,
1300
1301 // Versions: 3.51+
1302 NumberOfProcessors: ULONG,
1303 NtGlobalFlag: ULONG,
1304
1305 // Versions: all
1306 CriticalSectionTimeout: LARGE_INTEGER,
1307
1308 // End of Original PEB size
1309
1310 // Fields appended in 3.51:
1311 HeapSegmentReserve: ULONG_PTR,
1312 HeapSegmentCommit: ULONG_PTR,
1313 HeapDeCommitTotalFreeThreshold: ULONG_PTR,
1314 HeapDeCommitFreeBlockThreshold: ULONG_PTR,
1315 NumberOfHeaps: ULONG,
1316 MaximumNumberOfHeaps: ULONG,
1317 ProcessHeaps: *PVOID,
1318
1319 // Fields appended in 4.0:
1320 GdiSharedHandleTable: PVOID,
1321 ProcessStarterHelper: PVOID,
1322 GdiDCAttributeList: ULONG,
1323 // note: there is padding here on 64 bit
1324 LoaderLock: *RTL_CRITICAL_SECTION,
1325 OSMajorVersion: ULONG,
1326 OSMinorVersion: ULONG,
1327 OSBuildNumber: USHORT,
1328 OSCSDVersion: USHORT,
1329 OSPlatformId: ULONG,
1330 ImageSubSystem: ULONG,
1331 ImageSubSystemMajorVersion: ULONG,
1332 ImageSubSystemMinorVersion: ULONG,
1333 // note: there is padding here on 64 bit
1334 ActiveProcessAffinityMask: KAFFINITY,
1335 GdiHandleBuffer: [
1336 switch (@sizeOf(usize)) {
1337 4 => 0x22,
1338 8 => 0x3C,
1339 else => unreachable,
1340 }
1341 ]ULONG,
1342
1343 // Fields appended in 5.0 (Windows 2000):
1344 PostProcessInitRoutine: PVOID,
1345 TlsExpansionBitmap: PRTL_BITMAP,
1346 TlsExpansionBitmapBits: [32]ULONG,
1347 SessionId: ULONG,
1348 // note: there is padding here on 64 bit
1349 // Versions: 5.1+
1350 AppCompatFlags: ULARGE_INTEGER,
1351 AppCompatFlagsUser: ULARGE_INTEGER,
1352 ShimData: PVOID,
1353 // Versions: 5.0+
1354 AppCompatInfo: PVOID,
1355 CSDVersion: UNICODE_STRING,
1356
1357 // Fields appended in 5.1 (Windows XP):
1358 ActivationContextData: *const ACTIVATION_CONTEXT_DATA,
1359 ProcessAssemblyStorageMap: *ASSEMBLY_STORAGE_MAP,
1360 SystemDefaultActivationData: *const ACTIVATION_CONTEXT_DATA,
1361 SystemAssemblyStorageMap: *ASSEMBLY_STORAGE_MAP,
1362 MinimumStackCommit: ULONG_PTR,
1363
1364 // Fields appended in 5.2 (Windows Server 2003):
1365 FlsCallback: *FLS_CALLBACK_INFO,
1366 FlsListHead: LIST_ENTRY,
1367 FlsBitmap: PRTL_BITMAP,
1368 FlsBitmapBits: [4]ULONG,
1369 FlsHighIndex: ULONG,
1370
1371 // Fields appended in 6.0 (Windows Vista):
1372 WerRegistrationData: PVOID,
1373 WerShipAssertPtr: PVOID,
1374
1375 // Fields appended in 6.1 (Windows 7):
1376 pUnused: PVOID, // previously pContextData
1377 pImageHeaderHash: PVOID,
1378
1379 /// TODO: https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb/tracingflags.htm
1380 TracingFlags: ULONG,
1381
1382 // Fields appended in 6.2 (Windows 8):
1383 CsrServerReadOnlySharedMemoryBase: ULONGLONG,
1384
1385 // Fields appended in 1511:
1386 TppWorkerpListLock: ULONG,
1387 TppWorkerpList: LIST_ENTRY,
1388 WaitOnAddressHashTable: [0x80]PVOID,
1389
1390 // Fields appended in 1709:
1391 TelemetryCoverageHeader: PVOID,
1392 CloudFileFlags: ULONG,
1393};
1394
1395/// The `PEB_LDR_DATA` structure is the main record of what modules are loaded in a process.
1396/// It is essentially the head of three double-linked lists of `LDR_DATA_TABLE_ENTRY` structures which each represent one loaded module.
1397///
1398/// Microsoft documentation of this is incomplete, the fields here are taken from various resources including:
1399/// - https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb_ldr_data.htm
1400pub const PEB_LDR_DATA = extern struct {
1401 // Versions: 3.51 and higher
1402 /// The size in bytes of the structure
1403 Length: ULONG,
1404
1405 /// TRUE if the structure is prepared.
1406 Initialized: BOOLEAN,
1407
1408 SsHandle: PVOID,
1409 InLoadOrderModuleList: LIST_ENTRY,
1410 InMemoryOrderModuleList: LIST_ENTRY,
1411 InInitializationOrderModuleList: LIST_ENTRY,
1412
1413 // Versions: 5.1 and higher
1414
1415 /// No known use of this field is known in Windows 8 and higher.
1416 EntryInProgress: PVOID,
1417
1418 // Versions: 6.0 from Windows Vista SP1, and higher
1419 ShutdownInProgress: BOOLEAN,
1420
1421 /// Though ShutdownThreadId is declared as a HANDLE,
1422 /// it is indeed the thread ID as suggested by its name.
1423 /// It is picked up from the UniqueThread member of the CLIENT_ID in the
1424 /// TEB of the thread that asks to terminate the process.
1425 ShutdownThreadId: HANDLE,
1426};
1427
1428pub const RTL_USER_PROCESS_PARAMETERS = extern struct {
1429 AllocationSize: ULONG,
1430 Size: ULONG,
1431 Flags: ULONG,
1432 DebugFlags: ULONG,
1433 ConsoleHandle: HANDLE,
1434 ConsoleFlags: ULONG,
1435 hStdInput: HANDLE,
1436 hStdOutput: HANDLE,
1437 hStdError: HANDLE,
1438 CurrentDirectory: CURDIR,
1439 DllPath: UNICODE_STRING,
1440 ImagePathName: UNICODE_STRING,
1441 CommandLine: UNICODE_STRING,
1442 Environment: [*:0]WCHAR,
1443 dwX: ULONG,
1444 dwY: ULONG,
1445 dwXSize: ULONG,
1446 dwYSize: ULONG,
1447 dwXCountChars: ULONG,
1448 dwYCountChars: ULONG,
1449 dwFillAttribute: ULONG,
1450 dwFlags: ULONG,
1451 dwShowWindow: ULONG,
1452 WindowTitle: UNICODE_STRING,
1453 Desktop: UNICODE_STRING,
1454 ShellInfo: UNICODE_STRING,
1455 RuntimeInfo: UNICODE_STRING,
1456 DLCurrentDirectory: [0x20]RTL_DRIVE_LETTER_CURDIR,
1457};
1458
1459pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
1460 Flags: c_ushort,
1461 Length: c_ushort,
1462 TimeStamp: ULONG,
1463 DosPath: UNICODE_STRING,
1464};
1465
1466pub const PPS_POST_PROCESS_INIT_ROUTINE = ?fn () callconv(.C) void;
1467
1468pub const FILE_BOTH_DIR_INFORMATION = extern struct {
1469 NextEntryOffset: ULONG,
1470 FileIndex: ULONG,
1471 CreationTime: LARGE_INTEGER,
1472 LastAccessTime: LARGE_INTEGER,
1473 LastWriteTime: LARGE_INTEGER,
1474 ChangeTime: LARGE_INTEGER,
1475 EndOfFile: LARGE_INTEGER,
1476 AllocationSize: LARGE_INTEGER,
1477 FileAttributes: ULONG,
1478 FileNameLength: ULONG,
1479 EaSize: ULONG,
1480 ShortNameLength: CHAR,
1481 ShortName: [12]WCHAR,
1482 FileName: [1]WCHAR,
1483};
1484pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION;
1485
1486pub const IO_APC_ROUTINE = fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void;
1487
1488pub const CURDIR = extern struct {
1489 DosPath: UNICODE_STRING,
1490 Handle: HANDLE,
1491};
1492
1493pub const DUPLICATE_SAME_ACCESS = 2;
1494
1495pub const MODULEINFO = extern struct {
1496 lpBaseOfDll: LPVOID,
1497 SizeOfImage: DWORD,
1498 EntryPoint: LPVOID,
1499};
1500pub const LPMODULEINFO = *MODULEINFO;
1501
1502pub const PSAPI_WS_WATCH_INFORMATION = extern struct {
1503 FaultingPc: LPVOID,
1504 FaultingVa: LPVOID,
1505};
1506pub const PPSAPI_WS_WATCH_INFORMATION = *PSAPI_WS_WATCH_INFORMATION;
1507
1508pub const PROCESS_MEMORY_COUNTERS = extern struct {
1509 cb: DWORD,
1510 PageFaultCount: DWORD,
1511 PeakWorkingSetSize: SIZE_T,
1512 WorkingSetSize: SIZE_T,
1513 QuotaPeakPagedPoolUsage: SIZE_T,
1514 QuotaPagedPoolUsage: SIZE_T,
1515 QuotaPeakNonPagedPoolUsage: SIZE_T,
1516 QuotaNonPagedPoolUsage: SIZE_T,
1517 PagefileUsage: SIZE_T,
1518 PeakPagefileUsage: SIZE_T,
1519};
1520pub const PPROCESS_MEMORY_COUNTERS = *PROCESS_MEMORY_COUNTERS;
1521
1522pub const PROCESS_MEMORY_COUNTERS_EX = extern struct {
1523 cb: DWORD,
1524 PageFaultCount: DWORD,
1525 PeakWorkingSetSize: SIZE_T,
1526 WorkingSetSize: SIZE_T,
1527 QuotaPeakPagedPoolUsage: SIZE_T,
1528 QuotaPagedPoolUsage: SIZE_T,
1529 QuotaPeakNonPagedPoolUsage: SIZE_T,
1530 QuotaNonPagedPoolUsage: SIZE_T,
1531 PagefileUsage: SIZE_T,
1532 PeakPagefileUsage: SIZE_T,
1533 PrivateUsage: SIZE_T,
1534};
1535pub const PPROCESS_MEMORY_COUNTERS_EX = *PROCESS_MEMORY_COUNTERS_EX;
1536
1537pub const PERFORMANCE_INFORMATION = extern struct {
1538 cb: DWORD,
1539 CommitTotal: SIZE_T,
1540 CommitLimit: SIZE_T,
1541 CommitPeak: SIZE_T,
1542 PhysicalTotal: SIZE_T,
1543 PhysicalAvailable: SIZE_T,
1544 SystemCache: SIZE_T,
1545 KernelTotal: SIZE_T,
1546 KernelPaged: SIZE_T,
1547 KernelNonpaged: SIZE_T,
1548 PageSize: SIZE_T,
1549 HandleCount: DWORD,
1550 ProcessCount: DWORD,
1551 ThreadCount: DWORD,
1552};
1553pub const PPERFORMANCE_INFORMATION = *PERFORMANCE_INFORMATION;
1554
1555pub const PERFORMACE_INFORMATION = PERFORMANCE_INFORMATION;
1556pub const PPERFORMACE_INFORMATION = *PERFORMANCE_INFORMATION;
1557
1558pub const ENUM_PAGE_FILE_INFORMATION = extern struct {
1559 cb: DWORD,
1560 Reserved: DWORD,
1561 TotalSize: SIZE_T,
1562 TotalInUse: SIZE_T,
1563 PeakUsage: SIZE_T,
1564};
1565pub const PENUM_PAGE_FILE_INFORMATION = *ENUM_PAGE_FILE_INFORMATION;
1566
1567pub const PENUM_PAGE_FILE_CALLBACKW = ?fn (?LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL;
1568pub const PENUM_PAGE_FILE_CALLBACKA = ?fn (?LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL;
1569
1570pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {
1571 BasicInfo: PSAPI_WS_WATCH_INFORMATION,
1572 FaultingThreadId: ULONG_PTR,
1573 Flags: ULONG_PTR,
1574};
1575pub const PPSAPI_WS_WATCH_INFORMATION_EX = *PSAPI_WS_WATCH_INFORMATION_EX;
1576
1577pub const OSVERSIONINFOW = extern struct {
1578 dwOSVersionInfoSize: ULONG,
1579 dwMajorVersion: ULONG,
1580 dwMinorVersion: ULONG,
1581 dwBuildNumber: ULONG,
1582 dwPlatformId: ULONG,
1583 szCSDVersion: [128]WCHAR,
1584};
1585pub const POSVERSIONINFOW = *OSVERSIONINFOW;
1586pub const LPOSVERSIONINFOW = *OSVERSIONINFOW;
1587pub const RTL_OSVERSIONINFOW = OSVERSIONINFOW;
1588pub const PRTL_OSVERSIONINFOW = *RTL_OSVERSIONINFOW;
1589
1590pub const REPARSE_DATA_BUFFER = extern struct {
1591 ReparseTag: ULONG,
1592 ReparseDataLength: USHORT,
1593 Reserved: USHORT,
1594 DataBuffer: [1]UCHAR,
1595};
1596pub const SYMBOLIC_LINK_REPARSE_BUFFER = extern struct {
1597 SubstituteNameOffset: USHORT,
1598 SubstituteNameLength: USHORT,
1599 PrintNameOffset: USHORT,
1600 PrintNameLength: USHORT,
1601 Flags: ULONG,
1602 PathBuffer: [1]WCHAR,
1603};
1604pub const MOUNT_POINT_REPARSE_BUFFER = extern struct {
1605 SubstituteNameOffset: USHORT,
1606 SubstituteNameLength: USHORT,
1607 PrintNameOffset: USHORT,
1608 PrintNameLength: USHORT,
1609 PathBuffer: [1]WCHAR,
1610};
1611pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: ULONG = 16 * 1024;
1612pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
1613pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
1614pub const IO_REPARSE_TAG_SYMLINK: ULONG = 0xa000000c;
1615pub const IO_REPARSE_TAG_MOUNT_POINT: ULONG = 0xa0000003;
1616pub const SYMLINK_FLAG_RELATIVE: ULONG = 0x1;
1617
1618pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 0x1;
1619pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: DWORD = 0x2;
1620
1621pub const MOUNTMGR_MOUNT_POINT = extern struct {
1622 SymbolicLinkNameOffset: ULONG,
1623 SymbolicLinkNameLength: USHORT,
1624 Reserved1: USHORT,
1625 UniqueIdOffset: ULONG,
1626 UniqueIdLength: USHORT,
1627 Reserved2: USHORT,
1628 DeviceNameOffset: ULONG,
1629 DeviceNameLength: USHORT,
1630 Reserved3: USHORT,
1631};
1632pub const MOUNTMGR_MOUNT_POINTS = extern struct {
1633 Size: ULONG,
1634 NumberOfMountPoints: ULONG,
1635 MountPoints: [1]MOUNTMGR_MOUNT_POINT,
1636};
1637pub const IOCTL_MOUNTMGR_QUERY_POINTS: ULONG = 0x6d0008;
1638
1639pub const OBJECT_INFORMATION_CLASS = enum(c_int) {
1640 ObjectBasicInformation = 0,
1641 ObjectNameInformation = 1,
1642 ObjectTypeInformation = 2,
1643 ObjectTypesInformation = 3,
1644 ObjectHandleFlagInformation = 4,
1645 ObjectSessionInformation = 5,
1646 MaxObjectInfoClass,
1647};
1648
1649pub const OBJECT_NAME_INFORMATION = extern struct {
1650 Name: UNICODE_STRING,
1651};
1652pub const POBJECT_NAME_INFORMATION = *OBJECT_NAME_INFORMATION;
1653
1654pub const SRWLOCK = usize;
1655pub const SRWLOCK_INIT: SRWLOCK = 0;
1656pub const CONDITION_VARIABLE = usize;
1657pub const CONDITION_VARIABLE_INIT: CONDITION_VARIABLE = 0;
1658
1659pub const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 0x1;
1660pub const FILE_SKIP_SET_EVENT_ON_HANDLE = 0x2;
1661
1662pub const CTRL_C_EVENT: DWORD = 0;
1663pub const CTRL_BREAK_EVENT: DWORD = 1;
1664pub const CTRL_CLOSE_EVENT: DWORD = 2;
1665pub const CTRL_LOGOFF_EVENT: DWORD = 5;
1666pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;
1667
1668pub const HANDLER_ROUTINE = fn (dwCtrlType: DWORD) callconv(.C) BOOL;
lib/std/os/windows/gdi32.zig+7-1
......@@ -1,4 +1,10 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const BOOL = windows.BOOL;
4const DWORD = windows.DWORD;
5const WINAPI = windows.WINAPI;
6const HDC = windows.HDC;
7const HGLRC = windows.HGLRC;
28
39pub const PIXELFORMATDESCRIPTOR = extern struct {
410 nSize: WORD = @sizeOf(PIXELFORMATDESCRIPTOR),
lib/std/os/windows/kernel32.zig+55-18
......@@ -1,10 +1,47 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3
4const BOOL = windows.BOOL;
5const BOOLEAN = windows.BOOLEAN;
6const CONDITION_VARIABLE = windows.CONDITION_VARIABLE;
7const CONSOLE_SCREEN_BUFFER_INFO = windows.CONSOLE_SCREEN_BUFFER_INFO;
8const COORD = windows.COORD;
9const DWORD = windows.DWORD;
10const FILE_INFO_BY_HANDLE_CLASS = windows.FILE_INFO_BY_HANDLE_CLASS;
11const HANDLE = windows.HANDLE;
12const HMODULE = windows.HMODULE;
13const HRESULT = windows.HRESULT;
14const LARGE_INTEGER = windows.LARGE_INTEGER;
15const LPCWSTR = windows.LPCWSTR;
16const LPTHREAD_START_ROUTINE = windows.LPTHREAD_START_ROUTINE;
17const LPVOID = windows.LPVOID;
18const LPWSTR = windows.LPWSTR;
19const MODULEINFO = windows.MODULEINFO;
20const OVERLAPPED = windows.OVERLAPPED;
21const PERFORMANCE_INFORMATION = windows.PERFORMANCE_INFORMATION;
22const PROCESS_MEMORY_COUNTERS = windows.PROCESS_MEMORY_COUNTERS;
23const PSAPI_WS_WATCH_INFORMATION = windows.PSAPI_WS_WATCH_INFORMATION;
24const PSAPI_WS_WATCH_INFORMATION_EX = windows.PSAPI_WS_WATCH_INFORMATION_EX;
25const SECURITY_ATTRIBUTES = windows.SECURITY_ATTRIBUTES;
26const SIZE_T = windows.SIZE_T;
27const SRWLOCK = windows.SRWLOCK;
28const UINT = windows.UINT;
29const VECTORED_EXCEPTION_HANDLER = windows.VECTORED_EXCEPTION_HANDLER;
30const WCHAR = windows.WCHAR;
31const WINAPI = windows.WINAPI;
32const WORD = windows.WORD;
33const Win32Error = windows.Win32Error;
34const va_list = windows.va_list;
35const HLOCAL = windows.HLOCAL;
36const FILETIME = windows.FILETIME;
37const STARTUPINFOW = windows.STARTUPINFOW;
38const PROCESS_INFORMATION = windows.PROCESS_INFORMATION;
239
340pub extern "kernel32" fn AddVectoredExceptionHandler(First: c_ulong, Handler: ?VECTORED_EXCEPTION_HANDLER) callconv(WINAPI) ?*c_void;
441pub extern "kernel32" fn RemoveVectoredExceptionHandler(Handle: HANDLE) callconv(WINAPI) c_ulong;
542
643pub extern "kernel32" fn CancelIo(hFile: HANDLE) callconv(WINAPI) BOOL;
7pub extern "kernel32" fn CancelIoEx(hFile: HANDLE, lpOverlapped: ?LPOVERLAPPED) callconv(WINAPI) BOOL;
44pub extern "kernel32" fn CancelIoEx(hFile: HANDLE, lpOverlapped: ?*OVERLAPPED) callconv(WINAPI) BOOL;
845
946pub extern "kernel32" fn CloseHandle(hObject: HANDLE) callconv(WINAPI) BOOL;
1047
......@@ -22,7 +59,7 @@ pub extern "kernel32" fn CreateFileW(
2259 lpFileName: [*:0]const u16,
2360 dwDesiredAccess: DWORD,
2461 dwShareMode: DWORD,
25 lpSecurityAttributes: ?LPSECURITY_ATTRIBUTES,
62 lpSecurityAttributes: ?*SECURITY_ATTRIBUTES,
2663 dwCreationDisposition: DWORD,
2764 dwFlagsAndAttributes: DWORD,
2865 hTemplateFile: ?HANDLE,
......@@ -63,7 +100,7 @@ pub extern "kernel32" fn CreateSymbolicLinkW(lpSymlinkFileName: [*:0]const u16,
63100
64101pub extern "kernel32" fn CreateIoCompletionPort(FileHandle: HANDLE, ExistingCompletionPort: ?HANDLE, CompletionKey: ULONG_PTR, NumberOfConcurrentThreads: DWORD) callconv(WINAPI) ?HANDLE;
65102
66pub extern "kernel32" fn CreateThread(lpThreadAttributes: ?LPSECURITY_ATTRIBUTES, dwStackSize: SIZE_T, lpStartAddress: LPTHREAD_START_ROUTINE, lpParameter: ?LPVOID, dwCreationFlags: DWORD, lpThreadId: ?LPDWORD) callconv(WINAPI) ?HANDLE;
103pub extern "kernel32" fn CreateThread(lpThreadAttributes: ?*SECURITY_ATTRIBUTES, dwStackSize: SIZE_T, lpStartAddress: LPTHREAD_START_ROUTINE, lpParameter: ?LPVOID, dwCreationFlags: DWORD, lpThreadId: ?*DWORD) callconv(WINAPI) ?HANDLE;
67104
68105pub extern "kernel32" fn DeviceIoControl(
69106 h: HANDLE,
......@@ -96,9 +133,9 @@ pub extern "kernel32" fn GetCommandLineW() callconv(WINAPI) LPWSTR;
96133pub extern "kernel32" fn GetConsoleMode(in_hConsoleHandle: HANDLE, out_lpMode: *DWORD) callconv(WINAPI) BOOL;
97134
98135pub extern "kernel32" fn GetConsoleScreenBufferInfo(hConsoleOutput: HANDLE, lpConsoleScreenBufferInfo: *CONSOLE_SCREEN_BUFFER_INFO) callconv(WINAPI) BOOL;
99pub extern "kernel32" fn FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: CHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: LPDWORD) callconv(WINAPI) BOOL;
100pub extern "kernel32" fn FillConsoleOutputCharacterW(hConsoleOutput: HANDLE, cCharacter: WCHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: LPDWORD) callconv(WINAPI) BOOL;
101pub extern "kernel32" fn FillConsoleOutputAttribute(hConsoleOutput: HANDLE, wAttribute: WORD, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfAttrsWritten: LPDWORD) callconv(WINAPI) BOOL;
136pub extern "kernel32" fn FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: CHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: *DWORD) callconv(WINAPI) BOOL;
137pub extern "kernel32" fn FillConsoleOutputCharacterW(hConsoleOutput: HANDLE, cCharacter: WCHAR, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfCharsWritten: *DWORD) callconv(WINAPI) BOOL;
138pub extern "kernel32" fn FillConsoleOutputAttribute(hConsoleOutput: HANDLE, wAttribute: WORD, nLength: DWORD, dwWriteCoord: COORD, lpNumberOfAttrsWritten: *DWORD) callconv(WINAPI) BOOL;
102139pub extern "kernel32" fn SetConsoleCursorPosition(hConsoleOutput: HANDLE, dwCursorPosition: COORD) callconv(WINAPI) BOOL;
103140
104141pub extern "kernel32" fn GetCurrentDirectoryW(nBufferLength: DWORD, lpBuffer: ?[*]WCHAR) callconv(WINAPI) DWORD;
......@@ -156,7 +193,7 @@ pub extern "kernel32" fn GetFullPathNameW(
156193pub extern "kernel32" fn GetOverlappedResult(hFile: HANDLE, lpOverlapped: *OVERLAPPED, lpNumberOfBytesTransferred: *DWORD, bWait: BOOL) callconv(WINAPI) BOOL;
157194
158195pub extern "kernel32" fn GetProcessHeap() callconv(WINAPI) ?HANDLE;
159pub extern "kernel32" fn GetQueuedCompletionStatus(CompletionPort: HANDLE, lpNumberOfBytesTransferred: LPDWORD, lpCompletionKey: *ULONG_PTR, lpOverlapped: *?*OVERLAPPED, dwMilliseconds: DWORD) callconv(WINAPI) BOOL;
196pub extern "kernel32" fn GetQueuedCompletionStatus(CompletionPort: HANDLE, lpNumberOfBytesTransferred: *DWORD, lpCompletionKey: *ULONG_PTR, lpOverlapped: *?*OVERLAPPED, dwMilliseconds: DWORD) callconv(WINAPI) BOOL;
160197pub extern "kernel32" fn GetQueuedCompletionStatusEx(
161198 CompletionPort: HANDLE,
162199 lpCompletionPortEntries: [*]OVERLAPPED_ENTRY,
......@@ -282,7 +319,7 @@ pub extern "kernel32" fn WriteFile(
282319 in_out_lpOverlapped: ?*OVERLAPPED,
283320) callconv(WINAPI) BOOL;
284321
285pub extern "kernel32" fn WriteFileEx(hFile: HANDLE, lpBuffer: [*]const u8, nNumberOfBytesToWrite: DWORD, lpOverlapped: LPOVERLAPPED, lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE) callconv(WINAPI) BOOL;
322pub extern "kernel32" fn WriteFileEx(hFile: HANDLE, lpBuffer: [*]const u8, nNumberOfBytesToWrite: DWORD, lpOverlapped: *OVERLAPPED, lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE) callconv(WINAPI) BOOL;
286323
287324pub extern "kernel32" fn LoadLibraryW(lpLibFileName: [*:0]const u16) callconv(WINAPI) ?HMODULE;
288325
......@@ -298,12 +335,12 @@ pub extern "kernel32" fn DeleteCriticalSection(lpCriticalSection: *CRITICAL_SECT
298335pub extern "kernel32" fn InitOnceExecuteOnce(InitOnce: *INIT_ONCE, InitFn: INIT_ONCE_FN, Parameter: ?*c_void, Context: ?*c_void) callconv(WINAPI) BOOL;
299336
300337pub extern "kernel32" fn K32EmptyWorkingSet(hProcess: HANDLE) callconv(WINAPI) BOOL;
301pub extern "kernel32" fn K32EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: LPDWORD) callconv(WINAPI) BOOL;
338pub extern "kernel32" fn K32EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL;
302339pub extern "kernel32" fn K32EnumPageFilesA(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID) callconv(WINAPI) BOOL;
303340pub extern "kernel32" fn K32EnumPageFilesW(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID) callconv(WINAPI) BOOL;
304pub extern "kernel32" fn K32EnumProcessModules(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: LPDWORD) callconv(WINAPI) BOOL;
305pub extern "kernel32" fn K32EnumProcessModulesEx(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: LPDWORD, dwFilterFlag: DWORD) callconv(WINAPI) BOOL;
306pub extern "kernel32" fn K32EnumProcesses(lpidProcess: [*]DWORD, cb: DWORD, cbNeeded: LPDWORD) callconv(WINAPI) BOOL;
341pub extern "kernel32" fn K32EnumProcessModules(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL;
342pub extern "kernel32" fn K32EnumProcessModulesEx(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: *DWORD, dwFilterFlag: DWORD) callconv(WINAPI) BOOL;
343pub extern "kernel32" fn K32EnumProcesses(lpidProcess: [*]DWORD, cb: DWORD, cbNeeded: *DWORD) callconv(WINAPI) BOOL;
307344pub extern "kernel32" fn K32GetDeviceDriverBaseNameA(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
308345pub extern "kernel32" fn K32GetDeviceDriverBaseNameW(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
309346pub extern "kernel32" fn K32GetDeviceDriverFileNameA(ImageBase: LPVOID, lpFilename: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
......@@ -314,13 +351,13 @@ pub extern "kernel32" fn K32GetModuleBaseNameA(hProcess: HANDLE, hModule: ?HMODU
314351pub extern "kernel32" fn K32GetModuleBaseNameW(hProcess: HANDLE, hModule: ?HMODULE, lpBaseName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
315352pub extern "kernel32" fn K32GetModuleFileNameExA(hProcess: HANDLE, hModule: ?HMODULE, lpFilename: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
316353pub extern "kernel32" fn K32GetModuleFileNameExW(hProcess: HANDLE, hModule: ?HMODULE, lpFilename: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
317pub extern "kernel32" fn K32GetModuleInformation(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD) callconv(WINAPI) BOOL;
318pub extern "kernel32" fn K32GetPerformanceInfo(pPerformanceInformation: PPERFORMACE_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
354pub extern "kernel32" fn K32GetModuleInformation(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: *MODULEINFO, cb: DWORD) callconv(WINAPI) BOOL;
355pub extern "kernel32" fn K32GetPerformanceInfo(pPerformanceInformation: *PERFORMANCE_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
319356pub extern "kernel32" fn K32GetProcessImageFileNameA(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
320357pub extern "kernel32" fn K32GetProcessImageFileNameW(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
321pub extern "kernel32" fn K32GetProcessMemoryInfo(Process: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD) callconv(WINAPI) BOOL;
322pub extern "kernel32" fn K32GetWsChanges(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
323pub extern "kernel32" fn K32GetWsChangesEx(hProcess: HANDLE, lpWatchInfoEx: PPSAPI_WS_WATCH_INFORMATION_EX, cb: DWORD) callconv(WINAPI) BOOL;
358pub extern "kernel32" fn K32GetProcessMemoryInfo(Process: HANDLE, ppsmemCounters: *PROCESS_MEMORY_COUNTERS, cb: DWORD) callconv(WINAPI) BOOL;
359pub extern "kernel32" fn K32GetWsChanges(hProcess: HANDLE, lpWatchInfo: *PSAPI_WS_WATCH_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
360pub extern "kernel32" fn K32GetWsChangesEx(hProcess: HANDLE, lpWatchInfoEx: *PSAPI_WS_WATCH_INFORMATION_EX, cb: DWORD) callconv(WINAPI) BOOL;
324361pub extern "kernel32" fn K32InitializeProcessForWsWatch(hProcess: HANDLE) callconv(WINAPI) BOOL;
325362pub extern "kernel32" fn K32QueryWorkingSet(hProcess: HANDLE, pv: PVOID, cb: DWORD) callconv(WINAPI) BOOL;
326363pub extern "kernel32" fn K32QueryWorkingSetEx(hProcess: HANDLE, pv: PVOID, cb: DWORD) callconv(WINAPI) BOOL;
lib/std/os/windows/ntdll.zig+24-2
......@@ -1,7 +1,29 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3
4const BOOL = windows.BOOL;
5const DWORD = windows.DWORD;
6const ULONG = windows.ULONG;
7const WINAPI = windows.WINAPI;
8const NTSTATUS = windows.NTSTATUS;
9const WORD = windows.WORD;
10const HANDLE = windows.HANDLE;
11const ACCESS_MASK = windows.ACCESS_MASK;
12const IO_APC_ROUTINE = windows.IO_APC_ROUTINE;
13const BOOLEAN = windows.BOOLEAN;
14const OBJECT_ATTRIBUTES = windows.OBJECT_ATTRIBUTES;
15const PVOID = windows.PVOID;
16const IO_STATUS_BLOCK = windows.IO_STATUS_BLOCK;
17const LARGE_INTEGER = windows.LARGE_INTEGER;
18const OBJECT_INFORMATION_CLASS = windows.OBJECT_INFORMATION_CLASS;
19const FILE_INFORMATION_CLASS = windows.FILE_INFORMATION_CLASS;
20const UNICODE_STRING = windows.UNICODE_STRING;
21const RTL_OSVERSIONINFOW = windows.RTL_OSVERSIONINFOW;
22const FILE_BASIC_INFORMATION = windows.FILE_BASIC_INFORMATION;
23const SIZE_T = windows.SIZE_T;
224
325pub extern "NtDll" fn RtlGetVersion(
4 lpVersionInformation: PRTL_OSVERSIONINFOW,
26 lpVersionInformation: *RTL_OSVERSIONINFOW,
527) callconv(WINAPI) NTSTATUS;
628pub extern "NtDll" fn RtlCaptureStackBackTrace(
729 FramesToSkip: DWORD,
lib/std/os/windows/ole32.zig+6-1
......@@ -1,4 +1,9 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const WINAPI = windows.WINAPI;
4const LPVOID = windows.LPVOID;
5const DWORD = windows.DWORD;
6const HRESULT = windows.HRESULT;
27
38pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(WINAPI) void;
49pub extern "ole32" fn CoUninitialize() callconv(WINAPI) void;
lib/std/os/windows/psapi.zig+13-10
......@@ -1,12 +1,15 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const WINAPI = windows.WINAPI;
4const DWORD = windows.DWORD;
25
36pub extern "psapi" fn EmptyWorkingSet(hProcess: HANDLE) callconv(WINAPI) BOOL;
4pub extern "psapi" fn EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: LPDWORD) callconv(WINAPI) BOOL;
7pub extern "psapi" fn EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL;
58pub extern "psapi" fn EnumPageFilesA(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID) callconv(WINAPI) BOOL;
69pub extern "psapi" fn EnumPageFilesW(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID) callconv(WINAPI) BOOL;
7pub extern "psapi" fn EnumProcessModules(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: LPDWORD) callconv(WINAPI) BOOL;
8pub extern "psapi" fn EnumProcessModulesEx(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: LPDWORD, dwFilterFlag: DWORD) callconv(WINAPI) BOOL;
9pub extern "psapi" fn EnumProcesses(lpidProcess: [*]DWORD, cb: DWORD, cbNeeded: LPDWORD) callconv(WINAPI) BOOL;
10pub extern "psapi" fn EnumProcessModules(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL;
11pub extern "psapi" fn EnumProcessModulesEx(hProcess: HANDLE, lphModule: [*]HMODULE, cb: DWORD, lpcbNeeded: *DWORD, dwFilterFlag: DWORD) callconv(WINAPI) BOOL;
12pub extern "psapi" fn EnumProcesses(lpidProcess: [*]DWORD, cb: DWORD, cbNeeded: *DWORD) callconv(WINAPI) BOOL;
1013pub extern "psapi" fn GetDeviceDriverBaseNameA(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
1114pub extern "psapi" fn GetDeviceDriverBaseNameW(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
1215pub extern "psapi" fn GetDeviceDriverFileNameA(ImageBase: LPVOID, lpFilename: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
......@@ -17,13 +20,13 @@ pub extern "psapi" fn GetModuleBaseNameA(hProcess: HANDLE, hModule: ?HMODULE, lp
1720pub extern "psapi" fn GetModuleBaseNameW(hProcess: HANDLE, hModule: ?HMODULE, lpBaseName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
1821pub extern "psapi" fn GetModuleFileNameExA(hProcess: HANDLE, hModule: ?HMODULE, lpFilename: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
1922pub extern "psapi" fn GetModuleFileNameExW(hProcess: HANDLE, hModule: ?HMODULE, lpFilename: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
20pub extern "psapi" fn GetModuleInformation(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD) callconv(WINAPI) BOOL;
21pub extern "psapi" fn GetPerformanceInfo(pPerformanceInformation: PPERFORMACE_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
23pub extern "psapi" fn GetModuleInformation(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: *MODULEINFO, cb: DWORD) callconv(WINAPI) BOOL;
24pub extern "psapi" fn GetPerformanceInfo(pPerformanceInformation: *PERFORMANCE_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
2225pub extern "psapi" fn GetProcessImageFileNameA(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD) callconv(WINAPI) DWORD;
2326pub extern "psapi" fn GetProcessImageFileNameW(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD) callconv(WINAPI) DWORD;
24pub extern "psapi" fn GetProcessMemoryInfo(Process: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD) callconv(WINAPI) BOOL;
25pub extern "psapi" fn GetWsChanges(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
26pub extern "psapi" fn GetWsChangesEx(hProcess: HANDLE, lpWatchInfoEx: PPSAPI_WS_WATCH_INFORMATION_EX, cb: DWORD) callconv(WINAPI) BOOL;
27pub extern "psapi" fn GetProcessMemoryInfo(Process: HANDLE, ppsmemCounters: *PROCESS_MEMORY_COUNTERS, cb: DWORD) callconv(WINAPI) BOOL;
28pub extern "psapi" fn GetWsChanges(hProcess: HANDLE, lpWatchInfo: *PSAPI_WS_WATCH_INFORMATION, cb: DWORD) callconv(WINAPI) BOOL;
29pub extern "psapi" fn GetWsChangesEx(hProcess: HANDLE, lpWatchInfoEx: *PSAPI_WS_WATCH_INFORMATION_EX, cb: DWORD) callconv(WINAPI) BOOL;
2730pub extern "psapi" fn InitializeProcessForWsWatch(hProcess: HANDLE) callconv(WINAPI) BOOL;
2831pub extern "psapi" fn QueryWorkingSet(hProcess: HANDLE, pv: PVOID, cb: DWORD) callconv(WINAPI) BOOL;
2932pub extern "psapi" fn QueryWorkingSetEx(hProcess: HANDLE, pv: PVOID, cb: DWORD) callconv(WINAPI) BOOL;
lib/std/os/windows/shell32.zig+14-2
......@@ -1,3 +1,15 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const WINAPI = windows.WINAPI;
4const KNOWNFOLDERID = windows.KNOWNFOLDERID;
5const DWORD = windows.DWORD;
6const HANDLE = windows.HANDLE;
7const WCHAR = windows.WCHAR;
8const HRESULT = windows.HRESULT;
29
3pub extern "shell32" fn SHGetKnownFolderPath(rfid: *const KNOWNFOLDERID, dwFlags: DWORD, hToken: ?HANDLE, ppszPath: *[*:0]WCHAR) callconv(WINAPI) HRESULT;
10pub extern "shell32" fn SHGetKnownFolderPath(
11 rfid: *const KNOWNFOLDERID,
12 dwFlags: DWORD,
13 hToken: ?HANDLE,
14 ppszPath: *[*:0]WCHAR,
15) callconv(WINAPI) HRESULT;
lib/std/os/windows/user32.zig+2-4
......@@ -1,8 +1,6 @@
1usingnamespace @import("bits.zig");
2const std = @import("std");
3const builtin = std.builtin;
1const std = @import("../../std.zig");
42const assert = std.debug.assert;
5const windows = @import("../windows.zig");
3const windows = std.os.windows;
64const unexpectedError = windows.unexpectedError;
75const GetLastError = windows.kernel32.GetLastError;
86const SetLastError = windows.kernel32.SetLastError;
lib/std/os/windows/win32error.zig+1-1190
......@@ -1,3696 +1,2507 @@
1// Codes are from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d
1/// Codes are from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d
22pub const Win32Error = enum(u16) {
33 /// The operation completed successfully.
44 SUCCESS = 0,
5
65 /// Incorrect function.
76 INVALID_FUNCTION = 1,
8
97 /// The system cannot find the file specified.
108 FILE_NOT_FOUND = 2,
11
129 /// The system cannot find the path specified.
1310 PATH_NOT_FOUND = 3,
14
1511 /// The system cannot open the file.
1612 TOO_MANY_OPEN_FILES = 4,
17
1813 /// Access is denied.
1914 ACCESS_DENIED = 5,
20
2115 /// The handle is invalid.
2216 INVALID_HANDLE = 6,
23
2417 /// The storage control blocks were destroyed.
2518 ARENA_TRASHED = 7,
26
2719 /// Not enough storage is available to process this command.
2820 NOT_ENOUGH_MEMORY = 8,
29
3021 /// The storage control block address is invalid.
3122 INVALID_BLOCK = 9,
32
3323 /// The environment is incorrect.
3424 BAD_ENVIRONMENT = 10,
35
3625 /// An attempt was made to load a program with an incorrect format.
3726 BAD_FORMAT = 11,
38
3927 /// The access code is invalid.
4028 INVALID_ACCESS = 12,
41
4229 /// The data is invalid.
4330 INVALID_DATA = 13,
44
4531 /// Not enough storage is available to complete this operation.
4632 OUTOFMEMORY = 14,
47
4833 /// The system cannot find the drive specified.
4934 INVALID_DRIVE = 15,
50
5135 /// The directory cannot be removed.
5236 CURRENT_DIRECTORY = 16,
53
5437 /// The system cannot move the file to a different disk drive.
5538 NOT_SAME_DEVICE = 17,
56
5739 /// There are no more files.
5840 NO_MORE_FILES = 18,
59
6041 /// The media is write protected.
6142 WRITE_PROTECT = 19,
62
6343 /// The system cannot find the device specified.
6444 BAD_UNIT = 20,
65
6645 /// The device is not ready.
6746 NOT_READY = 21,
68
6947 /// The device does not recognize the command.
7048 BAD_COMMAND = 22,
71
7249 /// Data error (cyclic redundancy check).
7350 CRC = 23,
74
7551 /// The program issued a command but the command length is incorrect.
7652 BAD_LENGTH = 24,
77
7853 /// The drive cannot locate a specific area or track on the disk.
7954 SEEK = 25,
80
8155 /// The specified disk or diskette cannot be accessed.
8256 NOT_DOS_DISK = 26,
83
8457 /// The drive cannot find the sector requested.
8558 SECTOR_NOT_FOUND = 27,
86
8759 /// The printer is out of paper.
8860 OUT_OF_PAPER = 28,
89
9061 /// The system cannot write to the specified device.
9162 WRITE_FAULT = 29,
92
9363 /// The system cannot read from the specified device.
9464 READ_FAULT = 30,
95
9665 /// A device attached to the system is not functioning.
9766 GEN_FAILURE = 31,
98
9967 /// The process cannot access the file because it is being used by another process.
10068 SHARING_VIOLATION = 32,
101
10269 /// The process cannot access the file because another process has locked a portion of the file.
10370 LOCK_VIOLATION = 33,
104
10571 /// The wrong diskette is in the drive.
10672 /// Insert %2 (Volume Serial Number: %3) into drive %1.
10773 WRONG_DISK = 34,
108
10974 /// Too many files opened for sharing.
11075 SHARING_BUFFER_EXCEEDED = 36,
111
11276 /// Reached the end of the file.
11377 HANDLE_EOF = 38,
114
11578 /// The disk is full.
11679 HANDLE_DISK_FULL = 39,
117
11880 /// The request is not supported.
11981 NOT_SUPPORTED = 50,
120
12182 /// Windows cannot find the network path.
12283 /// Verify that the network path is correct and the destination computer is not busy or turned off.
12384 /// If Windows still cannot find the network path, contact your network administrator.
12485 REM_NOT_LIST = 51,
125
12686 /// You were not connected because a duplicate name exists on the network.
12787 /// If joining a domain, go to System in Control Panel to change the computer name and try again.
12888 /// If joining a workgroup, choose another workgroup name.
12989 DUP_NAME = 52,
130
13190 /// The network path was not found.
13291 BAD_NETPATH = 53,
133
13492 /// The network is busy.
13593 NETWORK_BUSY = 54,
136
13794 /// The specified network resource or device is no longer available.
13895 DEV_NOT_EXIST = 55,
139
14096 /// The network BIOS command limit has been reached.
14197 TOO_MANY_CMDS = 56,
142
14398 /// A network adapter hardware error occurred.
14499 ADAP_HDW_ERR = 57,
145
146100 /// The specified server cannot perform the requested operation.
147101 BAD_NET_RESP = 58,
148
149102 /// An unexpected network error occurred.
150103 UNEXP_NET_ERR = 59,
151
152104 /// The remote adapter is not compatible.
153105 BAD_REM_ADAP = 60,
154
155106 /// The printer queue is full.
156107 PRINTQ_FULL = 61,
157
158108 /// Space to store the file waiting to be printed is not available on the server.
159109 NO_SPOOL_SPACE = 62,
160
161110 /// Your file waiting to be printed was deleted.
162111 PRINT_CANCELLED = 63,
163
164112 /// The specified network name is no longer available.
165113 NETNAME_DELETED = 64,
166
167114 /// Network access is denied.
168115 NETWORK_ACCESS_DENIED = 65,
169
170116 /// The network resource type is not correct.
171117 BAD_DEV_TYPE = 66,
172
173118 /// The network name cannot be found.
174119 BAD_NET_NAME = 67,
175
176120 /// The name limit for the local computer network adapter card was exceeded.
177121 TOO_MANY_NAMES = 68,
178
179122 /// The network BIOS session limit was exceeded.
180123 TOO_MANY_SESS = 69,
181
182124 /// The remote server has been paused or is in the process of being started.
183125 SHARING_PAUSED = 70,
184
185126 /// No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept.
186127 REQ_NOT_ACCEP = 71,
187
188128 /// The specified printer or disk device has been paused.
189129 REDIR_PAUSED = 72,
190
191130 /// The file exists.
192131 FILE_EXISTS = 80,
193
194132 /// The directory or file cannot be created.
195133 CANNOT_MAKE = 82,
196
197134 /// Fail on INT 24.
198135 FAIL_I24 = 83,
199
200136 /// Storage to process this request is not available.
201137 OUT_OF_STRUCTURES = 84,
202
203138 /// The local device name is already in use.
204139 ALREADY_ASSIGNED = 85,
205
206140 /// The specified network password is not correct.
207141 INVALID_PASSWORD = 86,
208
209142 /// The parameter is incorrect.
210143 INVALID_PARAMETER = 87,
211
212144 /// A write fault occurred on the network.
213145 NET_WRITE_FAULT = 88,
214
215146 /// The system cannot start another process at this time.
216147 NO_PROC_SLOTS = 89,
217
218148 /// Cannot create another system semaphore.
219149 TOO_MANY_SEMAPHORES = 100,
220
221150 /// The exclusive semaphore is owned by another process.
222151 EXCL_SEM_ALREADY_OWNED = 101,
223
224152 /// The semaphore is set and cannot be closed.
225153 SEM_IS_SET = 102,
226
227154 /// The semaphore cannot be set again.
228155 TOO_MANY_SEM_REQUESTS = 103,
229
230156 /// Cannot request exclusive semaphores at interrupt time.
231157 INVALID_AT_INTERRUPT_TIME = 104,
232
233158 /// The previous ownership of this semaphore has ended.
234159 SEM_OWNER_DIED = 105,
235
236160 /// Insert the diskette for drive %1.
237161 SEM_USER_LIMIT = 106,
238
239162 /// The program stopped because an alternate diskette was not inserted.
240163 DISK_CHANGE = 107,
241
242164 /// The disk is in use or locked by another process.
243165 DRIVE_LOCKED = 108,
244
245166 /// The pipe has been ended.
246167 BROKEN_PIPE = 109,
247
248168 /// The system cannot open the device or file specified.
249169 OPEN_FAILED = 110,
250
251170 /// The file name is too long.
252171 BUFFER_OVERFLOW = 111,
253
254172 /// There is not enough space on the disk.
255173 DISK_FULL = 112,
256
257174 /// No more internal file identifiers available.
258175 NO_MORE_SEARCH_HANDLES = 113,
259
260176 /// The target internal file identifier is incorrect.
261177 INVALID_TARGET_HANDLE = 114,
262
263178 /// The IOCTL call made by the application program is not correct.
264179 INVALID_CATEGORY = 117,
265
266180 /// The verify-on-write switch parameter value is not correct.
267181 INVALID_VERIFY_SWITCH = 118,
268
269182 /// The system does not support the command requested.
270183 BAD_DRIVER_LEVEL = 119,
271
272184 /// This function is not supported on this system.
273185 CALL_NOT_IMPLEMENTED = 120,
274
275186 /// The semaphore timeout period has expired.
276187 SEM_TIMEOUT = 121,
277
278188 /// The data area passed to a system call is too small.
279189 INSUFFICIENT_BUFFER = 122,
280
281190 /// The filename, directory name, or volume label syntax is incorrect.
282191 INVALID_NAME = 123,
283
284192 /// The system call level is not correct.
285193 INVALID_LEVEL = 124,
286
287194 /// The disk has no volume label.
288195 NO_VOLUME_LABEL = 125,
289
290196 /// The specified module could not be found.
291197 MOD_NOT_FOUND = 126,
292
293198 /// The specified procedure could not be found.
294199 PROC_NOT_FOUND = 127,
295
296200 /// There are no child processes to wait for.
297201 WAIT_NO_CHILDREN = 128,
298
299202 /// The %1 application cannot be run in Win32 mode.
300203 CHILD_NOT_COMPLETE = 129,
301
302204 /// Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O.
303205 DIRECT_ACCESS_HANDLE = 130,
304
305206 /// An attempt was made to move the file pointer before the beginning of the file.
306207 NEGATIVE_SEEK = 131,
307
308208 /// The file pointer cannot be set on the specified device or file.
309209 SEEK_ON_DEVICE = 132,
310
311210 /// A JOIN or SUBST command cannot be used for a drive that contains previously joined drives.
312211 IS_JOIN_TARGET = 133,
313
314212 /// An attempt was made to use a JOIN or SUBST command on a drive that has already been joined.
315213 IS_JOINED = 134,
316
317214 /// An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted.
318215 IS_SUBSTED = 135,
319
320216 /// The system tried to delete the JOIN of a drive that is not joined.
321217 NOT_JOINED = 136,
322
323218 /// The system tried to delete the substitution of a drive that is not substituted.
324219 NOT_SUBSTED = 137,
325
326220 /// The system tried to join a drive to a directory on a joined drive.
327221 JOIN_TO_JOIN = 138,
328
329222 /// The system tried to substitute a drive to a directory on a substituted drive.
330223 SUBST_TO_SUBST = 139,
331
332224 /// The system tried to join a drive to a directory on a substituted drive.
333225 JOIN_TO_SUBST = 140,
334
335226 /// The system tried to SUBST a drive to a directory on a joined drive.
336227 SUBST_TO_JOIN = 141,
337
338228 /// The system cannot perform a JOIN or SUBST at this time.
339229 BUSY_DRIVE = 142,
340
341230 /// The system cannot join or substitute a drive to or for a directory on the same drive.
342231 SAME_DRIVE = 143,
343
344232 /// The directory is not a subdirectory of the root directory.
345233 DIR_NOT_ROOT = 144,
346
347234 /// The directory is not empty.
348235 DIR_NOT_EMPTY = 145,
349
350236 /// The path specified is being used in a substitute.
351237 IS_SUBST_PATH = 146,
352
353238 /// Not enough resources are available to process this command.
354239 IS_JOIN_PATH = 147,
355
356240 /// The path specified cannot be used at this time.
357241 PATH_BUSY = 148,
358
359242 /// An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute.
360243 IS_SUBST_TARGET = 149,
361
362244 /// System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
363245 SYSTEM_TRACE = 150,
364
365246 /// The number of specified semaphore events for DosMuxSemWait is not correct.
366247 INVALID_EVENT_COUNT = 151,
367
368248 /// DosMuxSemWait did not execute; too many semaphores are already set.
369249 TOO_MANY_MUXWAITERS = 152,
370
371250 /// The DosMuxSemWait list is not correct.
372251 INVALID_LIST_FORMAT = 153,
373
374252 /// The volume label you entered exceeds the label character limit of the target file system.
375253 LABEL_TOO_LONG = 154,
376
377254 /// Cannot create another thread.
378255 TOO_MANY_TCBS = 155,
379
380256 /// The recipient process has refused the signal.
381257 SIGNAL_REFUSED = 156,
382
383258 /// The segment is already discarded and cannot be locked.
384259 DISCARDED = 157,
385
386260 /// The segment is already unlocked.
387261 NOT_LOCKED = 158,
388
389262 /// The address for the thread ID is not correct.
390263 BAD_THREADID_ADDR = 159,
391
392264 /// One or more arguments are not correct.
393265 BAD_ARGUMENTS = 160,
394
395266 /// The specified path is invalid.
396267 BAD_PATHNAME = 161,
397
398268 /// A signal is already pending.
399269 SIGNAL_PENDING = 162,
400
401270 /// No more threads can be created in the system.
402271 MAX_THRDS_REACHED = 164,
403
404272 /// Unable to lock a region of a file.
405273 LOCK_FAILED = 167,
406
407274 /// The requested resource is in use.
408275 BUSY = 170,
409
410276 /// Device's command support detection is in progress.
411277 DEVICE_SUPPORT_IN_PROGRESS = 171,
412
413278 /// A lock request was not outstanding for the supplied cancel region.
414279 CANCEL_VIOLATION = 173,
415
416280 /// The file system does not support atomic changes to the lock type.
417281 ATOMIC_LOCKS_NOT_SUPPORTED = 174,
418
419282 /// The system detected a segment number that was not correct.
420283 INVALID_SEGMENT_NUMBER = 180,
421
422284 /// The operating system cannot run %1.
423285 INVALID_ORDINAL = 182,
424
425286 /// Cannot create a file when that file already exists.
426287 ALREADY_EXISTS = 183,
427
428288 /// The flag passed is not correct.
429289 INVALID_FLAG_NUMBER = 186,
430
431290 /// The specified system semaphore name was not found.
432291 SEM_NOT_FOUND = 187,
433
434292 /// The operating system cannot run %1.
435293 INVALID_STARTING_CODESEG = 188,
436
437294 /// The operating system cannot run %1.
438295 INVALID_STACKSEG = 189,
439
440296 /// The operating system cannot run %1.
441297 INVALID_MODULETYPE = 190,
442
443298 /// Cannot run %1 in Win32 mode.
444299 INVALID_EXE_SIGNATURE = 191,
445
446300 /// The operating system cannot run %1.
447301 EXE_MARKED_INVALID = 192,
448
449302 /// %1 is not a valid Win32 application.
450303 BAD_EXE_FORMAT = 193,
451
452304 /// The operating system cannot run %1.
453305 ITERATED_DATA_EXCEEDS_64k = 194,
454
455306 /// The operating system cannot run %1.
456307 INVALID_MINALLOCSIZE = 195,
457
458308 /// The operating system cannot run this application program.
459309 DYNLINK_FROM_INVALID_RING = 196,
460
461310 /// The operating system is not presently configured to run this application.
462311 IOPL_NOT_ENABLED = 197,
463
464312 /// The operating system cannot run %1.
465313 INVALID_SEGDPL = 198,
466
467314 /// The operating system cannot run this application program.
468315 AUTODATASEG_EXCEEDS_64k = 199,
469
470316 /// The code segment cannot be greater than or equal to 64K.
471317 RING2SEG_MUST_BE_MOVABLE = 200,
472
473318 /// The operating system cannot run %1.
474319 RELOC_CHAIN_XEEDS_SEGLIM = 201,
475
476320 /// The operating system cannot run %1.
477321 INFLOOP_IN_RELOC_CHAIN = 202,
478
479322 /// The system could not find the environment option that was entered.
480323 ENVVAR_NOT_FOUND = 203,
481
482324 /// No process in the command subtree has a signal handler.
483325 NO_SIGNAL_SENT = 205,
484
485326 /// The filename or extension is too long.
486327 FILENAME_EXCED_RANGE = 206,
487
488328 /// The ring 2 stack is in use.
489329 RING2_STACK_IN_USE = 207,
490
491330 /// The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified.
492331 META_EXPANSION_TOO_LONG = 208,
493
494332 /// The signal being posted is not correct.
495333 INVALID_SIGNAL_NUMBER = 209,
496
497334 /// The signal handler cannot be set.
498335 THREAD_1_INACTIVE = 210,
499
500336 /// The segment is locked and cannot be reallocated.
501337 LOCKED = 212,
502
503338 /// Too many dynamic-link modules are attached to this program or dynamic-link module.
504339 TOO_MANY_MODULES = 214,
505
506340 /// Cannot nest calls to LoadModule.
507341 NESTING_NOT_ALLOWED = 215,
508
509342 /// This version of %1 is not compatible with the version of Windows you're running.
510343 /// Check your computer's system information and then contact the software publisher.
511344 EXE_MACHINE_TYPE_MISMATCH = 216,
512
513345 /// The image file %1 is signed, unable to modify.
514346 EXE_CANNOT_MODIFY_SIGNED_BINARY = 217,
515
516347 /// The image file %1 is strong signed, unable to modify.
517348 EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY = 218,
518
519349 /// This file is checked out or locked for editing by another user.
520350 FILE_CHECKED_OUT = 220,
521
522351 /// The file must be checked out before saving changes.
523352 CHECKOUT_REQUIRED = 221,
524
525353 /// The file type being saved or retrieved has been blocked.
526354 BAD_FILE_TYPE = 222,
527
528355 /// The file size exceeds the limit allowed and cannot be saved.
529356 FILE_TOO_LARGE = 223,
530
531357 /// Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.
532358 FORMS_AUTH_REQUIRED = 224,
533
534359 /// Operation did not complete successfully because the file contains a virus or potentially unwanted software.
535360 VIRUS_INFECTED = 225,
536
537361 /// This file contains a virus or potentially unwanted software and cannot be opened.
538362 /// Due to the nature of this virus or potentially unwanted software, the file has been removed from this location.
539363 VIRUS_DELETED = 226,
540
541364 /// The pipe is local.
542365 PIPE_LOCAL = 229,
543
544366 /// The pipe state is invalid.
545367 BAD_PIPE = 230,
546
547368 /// All pipe instances are busy.
548369 PIPE_BUSY = 231,
549
550370 /// The pipe is being closed.
551371 NO_DATA = 232,
552
553372 /// No process is on the other end of the pipe.
554373 PIPE_NOT_CONNECTED = 233,
555
556374 /// More data is available.
557375 MORE_DATA = 234,
558
559376 /// The session was canceled.
560377 VC_DISCONNECTED = 240,
561
562378 /// The specified extended attribute name was invalid.
563379 INVALID_EA_NAME = 254,
564
565380 /// The extended attributes are inconsistent.
566381 EA_LIST_INCONSISTENT = 255,
567
568382 /// The wait operation timed out.
569383 IMEOUT = 258,
570
571384 /// No more data is available.
572385 NO_MORE_ITEMS = 259,
573
574386 /// The copy functions cannot be used.
575387 CANNOT_COPY = 266,
576
577388 /// The directory name is invalid.
578389 DIRECTORY = 267,
579
580390 /// The extended attributes did not fit in the buffer.
581391 EAS_DIDNT_FIT = 275,
582
583392 /// The extended attribute file on the mounted file system is corrupt.
584393 EA_FILE_CORRUPT = 276,
585
586394 /// The extended attribute table file is full.
587395 EA_TABLE_FULL = 277,
588
589396 /// The specified extended attribute handle is invalid.
590397 INVALID_EA_HANDLE = 278,
591
592398 /// The mounted file system does not support extended attributes.
593399 EAS_NOT_SUPPORTED = 282,
594
595400 /// Attempt to release mutex not owned by caller.
596401 NOT_OWNER = 288,
597
598402 /// Too many posts were made to a semaphore.
599403 TOO_MANY_POSTS = 298,
600
601404 /// Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
602405 PARTIAL_COPY = 299,
603
604406 /// The oplock request is denied.
605407 OPLOCK_NOT_GRANTED = 300,
606
607408 /// An invalid oplock acknowledgment was received by the system.
608409 INVALID_OPLOCK_PROTOCOL = 301,
609
610410 /// The volume is too fragmented to complete this operation.
611411 DISK_TOO_FRAGMENTED = 302,
612
613412 /// The file cannot be opened because it is in the process of being deleted.
614413 DELETE_PENDING = 303,
615
616414 /// Short name settings may not be changed on this volume due to the global registry setting.
617415 INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 304,
618
619416 /// Short names are not enabled on this volume.
620417 SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 305,
621
622418 /// The security stream for the given volume is in an inconsistent state. Please run CHKDSK on the volume.
623419 SECURITY_STREAM_IS_INCONSISTENT = 306,
624
625420 /// A requested file lock operation cannot be processed due to an invalid byte range.
626421 INVALID_LOCK_RANGE = 307,
627
628422 /// The subsystem needed to support the image type is not present.
629423 IMAGE_SUBSYSTEM_NOT_PRESENT = 308,
630
631424 /// The specified file already has a notification GUID associated with it.
632425 NOTIFICATION_GUID_ALREADY_DEFINED = 309,
633
634426 /// An invalid exception handler routine has been detected.
635427 INVALID_EXCEPTION_HANDLER = 310,
636
637428 /// Duplicate privileges were specified for the token.
638429 DUPLICATE_PRIVILEGES = 311,
639
640430 /// No ranges for the specified operation were able to be processed.
641431 NO_RANGES_PROCESSED = 312,
642
643432 /// Operation is not allowed on a file system internal file.
644433 NOT_ALLOWED_ON_SYSTEM_FILE = 313,
645
646434 /// The physical resources of this disk have been exhausted.
647435 DISK_RESOURCES_EXHAUSTED = 314,
648
649436 /// The token representing the data is invalid.
650437 INVALID_TOKEN = 315,
651
652438 /// The device does not support the command feature.
653439 DEVICE_FEATURE_NOT_SUPPORTED = 316,
654
655440 /// The system cannot find message text for message number 0x%1 in the message file for %2.
656441 MR_MID_NOT_FOUND = 317,
657
658442 /// The scope specified was not found.
659443 SCOPE_NOT_FOUND = 318,
660
661444 /// The Central Access Policy specified is not defined on the target machine.
662445 UNDEFINED_SCOPE = 319,
663
664446 /// The Central Access Policy obtained from Active Directory is invalid.
665447 INVALID_CAP = 320,
666
667448 /// The device is unreachable.
668449 DEVICE_UNREACHABLE = 321,
669
670450 /// The target device has insufficient resources to complete the operation.
671451 DEVICE_NO_RESOURCES = 322,
672
673452 /// A data integrity checksum error occurred. Data in the file stream is corrupt.
674453 DATA_CHECKSUM_ERROR = 323,
675
676454 /// An attempt was made to modify both a KERNEL and normal Extended Attribute (EA) in the same operation.
677455 INTERMIXED_KERNEL_EA_OPERATION = 324,
678
679456 /// Device does not support file-level TRIM.
680457 FILE_LEVEL_TRIM_NOT_SUPPORTED = 326,
681
682458 /// The command specified a data offset that does not align to the device's granularity/alignment.
683459 OFFSET_ALIGNMENT_VIOLATION = 327,
684
685460 /// The command specified an invalid field in its parameter list.
686461 INVALID_FIELD_IN_PARAMETER_LIST = 328,
687
688462 /// An operation is currently in progress with the device.
689463 OPERATION_IN_PROGRESS = 329,
690
691464 /// An attempt was made to send down the command via an invalid path to the target device.
692465 BAD_DEVICE_PATH = 330,
693
694466 /// The command specified a number of descriptors that exceeded the maximum supported by the device.
695467 TOO_MANY_DESCRIPTORS = 331,
696
697468 /// Scrub is disabled on the specified file.
698469 SCRUB_DATA_DISABLED = 332,
699
700470 /// The storage device does not provide redundancy.
701471 NOT_REDUNDANT_STORAGE = 333,
702
703472 /// An operation is not supported on a resident file.
704473 RESIDENT_FILE_NOT_SUPPORTED = 334,
705
706474 /// An operation is not supported on a compressed file.
707475 COMPRESSED_FILE_NOT_SUPPORTED = 335,
708
709476 /// An operation is not supported on a directory.
710477 DIRECTORY_NOT_SUPPORTED = 336,
711
712478 /// The specified copy of the requested data could not be read.
713479 NOT_READ_FROM_COPY = 337,
714
715480 /// No action was taken as a system reboot is required.
716481 FAIL_NOACTION_REBOOT = 350,
717
718482 /// The shutdown operation failed.
719483 FAIL_SHUTDOWN = 351,
720
721484 /// The restart operation failed.
722485 FAIL_RESTART = 352,
723
724486 /// The maximum number of sessions has been reached.
725487 MAX_SESSIONS_REACHED = 353,
726
727488 /// The thread is already in background processing mode.
728489 THREAD_MODE_ALREADY_BACKGROUND = 400,
729
730490 /// The thread is not in background processing mode.
731491 THREAD_MODE_NOT_BACKGROUND = 401,
732
733492 /// The process is already in background processing mode.
734493 PROCESS_MODE_ALREADY_BACKGROUND = 402,
735
736494 /// The process is not in background processing mode.
737495 PROCESS_MODE_NOT_BACKGROUND = 403,
738
739496 /// Attempt to access invalid address.
740497 INVALID_ADDRESS = 487,
741
742498 /// User profile cannot be loaded.
743499 USER_PROFILE_LOAD = 500,
744
745500 /// Arithmetic result exceeded 32 bits.
746501 ARITHMETIC_OVERFLOW = 534,
747
748502 /// There is a process on other end of the pipe.
749503 PIPE_CONNECTED = 535,
750
751504 /// Waiting for a process to open the other end of the pipe.
752505 PIPE_LISTENING = 536,
753
754506 /// Application verifier has found an error in the current process.
755507 VERIFIER_STOP = 537,
756
757508 /// An error occurred in the ABIOS subsystem.
758509 ABIOS_ERROR = 538,
759
760510 /// A warning occurred in the WX86 subsystem.
761511 WX86_WARNING = 539,
762
763512 /// An error occurred in the WX86 subsystem.
764513 WX86_ERROR = 540,
765
766514 /// An attempt was made to cancel or set a timer that has an associated APC and the subject thread is not the thread that originally set the timer with an associated APC routine.
767515 TIMER_NOT_CANCELED = 541,
768
769516 /// Unwind exception code.
770517 UNWIND = 542,
771
772518 /// An invalid or unaligned stack was encountered during an unwind operation.
773519 BAD_STACK = 543,
774
775520 /// An invalid unwind target was encountered during an unwind operation.
776521 INVALID_UNWIND_TARGET = 544,
777
778522 /// Invalid Object Attributes specified to NtCreatePort or invalid Port Attributes specified to NtConnectPort
779523 INVALID_PORT_ATTRIBUTES = 545,
780
781524 /// Length of message passed to NtRequestPort or NtRequestWaitReplyPort was longer than the maximum message allowed by the port.
782525 PORT_MESSAGE_TOO_LONG = 546,
783
784526 /// An attempt was made to lower a quota limit below the current usage.
785527 INVALID_QUOTA_LOWER = 547,
786
787528 /// An attempt was made to attach to a device that was already attached to another device.
788529 DEVICE_ALREADY_ATTACHED = 548,
789
790530 /// An attempt was made to execute an instruction at an unaligned address and the host system does not support unaligned instruction references.
791531 INSTRUCTION_MISALIGNMENT = 549,
792
793532 /// Profiling not started.
794533 PROFILING_NOT_STARTED = 550,
795
796534 /// Profiling not stopped.
797535 PROFILING_NOT_STOPPED = 551,
798
799536 /// The passed ACL did not contain the minimum required information.
800537 COULD_NOT_INTERPRET = 552,
801
802538 /// The number of active profiling objects is at the maximum and no more may be started.
803539 PROFILING_AT_LIMIT = 553,
804
805540 /// Used to indicate that an operation cannot continue without blocking for I/O.
806541 CANT_WAIT = 554,
807
808542 /// Indicates that a thread attempted to terminate itself by default (called NtTerminateThread with NULL) and it was the last thread in the current process.
809543 CANT_TERMINATE_SELF = 555,
810
811544 /// If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter.
812545 /// In this case information is lost, however, the filter correctly handles the exception.
813546 UNEXPECTED_MM_CREATE_ERR = 556,
814
815547 /// If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter.
816548 /// In this case information is lost, however, the filter correctly handles the exception.
817549 UNEXPECTED_MM_MAP_ERROR = 557,
818
819550 /// If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter.
820551 /// In this case information is lost, however, the filter correctly handles the exception.
821552 UNEXPECTED_MM_EXTEND_ERR = 558,
822
823553 /// A malformed function table was encountered during an unwind operation.
824554 BAD_FUNCTION_TABLE = 559,
825
826555 /// Indicates that an attempt was made to assign protection to a file system file or directory and one of the SIDs in the security descriptor could not be translated into a GUID that could be stored by the file system.
827556 /// This causes the protection attempt to fail, which may cause a file creation attempt to fail.
828557 NO_GUID_TRANSLATION = 560,
829
830558 /// Indicates that an attempt was made to grow an LDT by setting its size, or that the size was not an even number of selectors.
831559 INVALID_LDT_SIZE = 561,
832
833560 /// Indicates that the starting value for the LDT information was not an integral multiple of the selector size.
834561 INVALID_LDT_OFFSET = 563,
835
836562 /// Indicates that the user supplied an invalid descriptor when trying to set up Ldt descriptors.
837563 INVALID_LDT_DESCRIPTOR = 564,
838
839564 /// Indicates a process has too many threads to perform the requested action.
840565 /// For example, assignment of a primary token may only be performed when a process has zero or one threads.
841566 TOO_MANY_THREADS = 565,
842
843567 /// An attempt was made to operate on a thread within a specific process, but the thread specified is not in the process specified.
844568 THREAD_NOT_IN_PROCESS = 566,
845
846569 /// Page file quota was exceeded.
847570 PAGEFILE_QUOTA_EXCEEDED = 567,
848
849571 /// The Netlogon service cannot start because another Netlogon service running in the domain conflicts with the specified role.
850572 LOGON_SERVER_CONFLICT = 568,
851
852573 /// The SAM database on a Windows Server is significantly out of synchronization with the copy on the Domain Controller. A complete synchronization is required.
853574 SYNCHRONIZATION_REQUIRED = 569,
854
855575 /// The NtCreateFile API failed. This error should never be returned to an application, it is a place holder for the Windows Lan Manager Redirector to use in its internal error mapping routines.
856576 NET_OPEN_FAILED = 570,
857
858577 /// {Privilege Failed} The I/O permissions for the process could not be changed.
859578 IO_PRIVILEGE_FAILED = 571,
860
861579 /// {Application Exit by CTRL+C} The application terminated as a result of a CTRL+C.
862580 CONTROL_C_EXIT = 572,
863
864581 /// {Missing System File} The required system file %hs is bad or missing.
865582 MISSING_SYSTEMFILE = 573,
866
867583 /// {Application Error} The exception %s (0x%08lx) occurred in the application at location 0x%08lx.
868584 UNHANDLED_EXCEPTION = 574,
869
870585 /// {Application Error} The application was unable to start correctly (0x%lx). Click OK to close the application.
871586 APP_INIT_FAILURE = 575,
872
873587 /// {Unable to Create Paging File} The creation of the paging file %hs failed (%lx). The requested size was %ld.
874588 PAGEFILE_CREATE_FAILED = 576,
875
876589 /// Windows cannot verify the digital signature for this file.
877590 /// A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source.
878591 INVALID_IMAGE_HASH = 577,
879
880592 /// {No Paging File Specified} No paging file was specified in the system configuration.
881593 NO_PAGEFILE = 578,
882
883594 /// {EXCEPTION} A real-mode application issued a floating-point instruction and floating-point hardware is not present.
884595 ILLEGAL_FLOAT_CONTEXT = 579,
885
886596 /// An event pair synchronization operation was performed using the thread specific client/server event pair object, but no event pair object was associated with the thread.
887597 NO_EVENT_PAIR = 580,
888
889598 /// A Windows Server has an incorrect configuration.
890599 DOMAIN_CTRLR_CONFIG_ERROR = 581,
891
892600 /// An illegal character was encountered.
893601 /// For a multi-byte character set this includes a lead byte without a succeeding trail byte.
894602 /// For the Unicode character set this includes the characters 0xFFFF and 0xFFFE.
895603 ILLEGAL_CHARACTER = 582,
896
897604 /// The Unicode character is not defined in the Unicode character set installed on the system.
898605 UNDEFINED_CHARACTER = 583,
899
900606 /// The paging file cannot be created on a floppy diskette.
901607 FLOPPY_VOLUME = 584,
902
903608 /// The system BIOS failed to connect a system interrupt to the device or bus for which the device is connected.
904609 BIOS_FAILED_TO_CONNECT_INTERRUPT = 585,
905
906610 /// This operation is only allowed for the Primary Domain Controller of the domain.
907611 BACKUP_CONTROLLER = 586,
908
909612 /// An attempt was made to acquire a mutant such that its maximum count would have been exceeded.
910613 MUTANT_LIMIT_EXCEEDED = 587,
911
912614 /// A volume has been accessed for which a file system driver is required that has not yet been loaded.
913615 FS_DRIVER_REQUIRED = 588,
914
915616 /// {Registry File Failure} The registry cannot load the hive (file): %hs or its log or alternate. It is corrupt, absent, or not writable.
916617 CANNOT_LOAD_REGISTRY_FILE = 589,
917
918618 /// {Unexpected Failure in DebugActiveProcess} An unexpected failure occurred while processing a DebugActiveProcess API request.
919619 /// You may choose OK to terminate the process, or Cancel to ignore the error.
920620 DEBUG_ATTACH_FAILED = 590,
921
922621 /// {Fatal System Error} The %hs system process terminated unexpectedly with a status of 0x%08x (0x%08x 0x%08x). The system has been shut down.
923622 SYSTEM_PROCESS_TERMINATED = 591,
924
925623 /// {Data Not Accepted} The TDI client could not handle the data received during an indication.
926624 DATA_NOT_ACCEPTED = 592,
927
928625 /// NTVDM encountered a hard error.
929626 VDM_HARD_ERROR = 593,
930
931627 /// {Cancel Timeout} The driver %hs failed to complete a cancelled I/O request in the allotted time.
932628 DRIVER_CANCEL_TIMEOUT = 594,
933
934629 /// {Reply Message Mismatch} An attempt was made to reply to an LPC message, but the thread specified by the client ID in the message was not waiting on that message.
935630 REPLY_MESSAGE_MISMATCH = 595,
936
937631 /// {Delayed Write Failed} Windows was unable to save all the data for the file %hs. The data has been lost.
938632 /// This error may be caused by a failure of your computer hardware or network connection. Please try to save this file elsewhere.
939633 LOST_WRITEBEHIND_DATA = 596,
940
941634 /// The parameter(s) passed to the server in the client/server shared memory window were invalid.
942635 /// Too much data may have been put in the shared memory window.
943636 CLIENT_SERVER_PARAMETERS_INVALID = 597,
944
945637 /// The stream is not a tiny stream.
946638 NOT_TINY_STREAM = 598,
947
948639 /// The request must be handled by the stack overflow code.
949640 STACK_OVERFLOW_READ = 599,
950
951641 /// Internal OFS status codes indicating how an allocation operation is handled.
952642 /// Either it is retried after the containing onode is moved or the extent stream is converted to a large stream.
953643 CONVERT_TO_LARGE = 600,
954
955644 /// The attempt to find the object found an object matching by ID on the volume but it is out of the scope of the handle used for the operation.
956645 FOUND_OUT_OF_SCOPE = 601,
957
958646 /// The bucket array must be grown. Retry transaction after doing so.
959647 ALLOCATE_BUCKET = 602,
960
961648 /// The user/kernel marshalling buffer has overflowed.
962649 MARSHALL_OVERFLOW = 603,
963
964650 /// The supplied variant structure contains invalid data.
965651 INVALID_VARIANT = 604,
966
967652 /// The specified buffer contains ill-formed data.
968653 BAD_COMPRESSION_BUFFER = 605,
969
970654 /// {Audit Failed} An attempt to generate a security audit failed.
971655 AUDIT_FAILED = 606,
972
973656 /// The timer resolution was not previously set by the current process.
974657 TIMER_RESOLUTION_NOT_SET = 607,
975
976658 /// There is insufficient account information to log you on.
977659 INSUFFICIENT_LOGON_INFO = 608,
978
979660 /// {Invalid DLL Entrypoint} The dynamic link library %hs is not written correctly.
980661 /// The stack pointer has been left in an inconsistent state.
981662 /// The entrypoint should be declared as WINAPI or STDCALL.
982663 /// Select YES to fail the DLL load. Select NO to continue execution.
983664 /// Selecting NO may cause the application to operate incorrectly.
984665 BAD_DLL_ENTRYPOINT = 609,
985
986666 /// {Invalid Service Callback Entrypoint} The %hs service is not written correctly.
987667 /// The stack pointer has been left in an inconsistent state.
988668 /// The callback entrypoint should be declared as WINAPI or STDCALL.
989669 /// Selecting OK will cause the service to continue operation.
990670 /// However, the service process may operate incorrectly.
991671 BAD_SERVICE_ENTRYPOINT = 610,
992
993672 /// There is an IP address conflict with another system on the network.
994673 IP_ADDRESS_CONFLICT1 = 611,
995
996674 /// There is an IP address conflict with another system on the network.
997675 IP_ADDRESS_CONFLICT2 = 612,
998
999676 /// {Low On Registry Space} The system has reached the maximum size allowed for the system part of the registry. Additional storage requests will be ignored.
1000677 REGISTRY_QUOTA_LIMIT = 613,
1001
1002678 /// A callback return system service cannot be executed when no callback is active.
1003679 NO_CALLBACK_ACTIVE = 614,
1004
1005680 /// The password provided is too short to meet the policy of your user account. Please choose a longer password.
1006681 PWD_TOO_SHORT = 615,
1007
1008682 /// The policy of your user account does not allow you to change passwords too frequently.
1009683 /// This is done to prevent users from changing back to a familiar, but potentially discovered, password.
1010684 /// If you feel your password has been compromised then please contact your administrator immediately to have a new one assigned.
1011685 PWD_TOO_RECENT = 616,
1012
1013686 /// You have attempted to change your password to one that you have used in the past.
1014687 /// The policy of your user account does not allow this.
1015688 /// Please select a password that you have not previously used.
1016689 PWD_HISTORY_CONFLICT = 617,
1017
1018690 /// The specified compression format is unsupported.
1019691 UNSUPPORTED_COMPRESSION = 618,
1020
1021692 /// The specified hardware profile configuration is invalid.
1022693 INVALID_HW_PROFILE = 619,
1023
1024694 /// The specified Plug and Play registry device path is invalid.
1025695 INVALID_PLUGPLAY_DEVICE_PATH = 620,
1026
1027696 /// The specified quota list is internally inconsistent with its descriptor.
1028697 QUOTA_LIST_INCONSISTENT = 621,
1029
1030698 /// {Windows Evaluation Notification} The evaluation period for this installation of Windows has expired. This system will shutdown in 1 hour.
1031699 /// To restore access to this installation of Windows, please upgrade this installation using a licensed distribution of this product.
1032700 EVALUATION_EXPIRATION = 622,
1033
1034701 /// {Illegal System DLL Relocation} The system DLL %hs was relocated in memory. The application will not run properly.
1035702 /// The relocation occurred because the DLL %hs occupied an address range reserved for Windows system DLLs.
1036703 /// The vendor supplying the DLL should be contacted for a new DLL.
1037704 ILLEGAL_DLL_RELOCATION = 623,
1038
1039705 /// {DLL Initialization Failed} The application failed to initialize because the window station is shutting down.
1040706 DLL_INIT_FAILED_LOGOFF = 624,
1041
1042707 /// The validation process needs to continue on to the next step.
1043708 VALIDATE_CONTINUE = 625,
1044
1045709 /// There are no more matches for the current index enumeration.
1046710 NO_MORE_MATCHES = 626,
1047
1048711 /// The range could not be added to the range list because of a conflict.
1049712 RANGE_LIST_CONFLICT = 627,
1050
1051713 /// The server process is running under a SID different than that required by client.
1052714 SERVER_SID_MISMATCH = 628,
1053
1054715 /// A group marked use for deny only cannot be enabled.
1055716 CANT_ENABLE_DENY_ONLY = 629,
1056
1057717 /// {EXCEPTION} Multiple floating point faults.
1058718 FLOAT_MULTIPLE_FAULTS = 630,
1059
1060719 /// {EXCEPTION} Multiple floating point traps.
1061720 FLOAT_MULTIPLE_TRAPS = 631,
1062
1063721 /// The requested interface is not supported.
1064722 NOINTERFACE = 632,
1065
1066723 /// {System Standby Failed} The driver %hs does not support standby mode.
1067724 /// Updating this driver may allow the system to go to standby mode.
1068725 DRIVER_FAILED_SLEEP = 633,
1069
1070726 /// The system file %1 has become corrupt and has been replaced.
1071727 CORRUPT_SYSTEM_FILE = 634,
1072
1073728 /// {Virtual Memory Minimum Too Low} Your system is low on virtual memory.
1074729 /// Windows is increasing the size of your virtual memory paging file.
1075730 /// During this process, memory requests for some applications may be denied. For more information, see Help.
1076731 COMMITMENT_MINIMUM = 635,
1077
1078732 /// A device was removed so enumeration must be restarted.
1079733 PNP_RESTART_ENUMERATION = 636,
1080
1081734 /// {Fatal System Error} The system image %s is not properly signed.
1082735 /// The file has been replaced with the signed file. The system has been shut down.
1083736 SYSTEM_IMAGE_BAD_SIGNATURE = 637,
1084
1085737 /// Device will not start without a reboot.
1086738 PNP_REBOOT_REQUIRED = 638,
1087
1088739 /// There is not enough power to complete the requested operation.
1089740 INSUFFICIENT_POWER = 639,
1090
1091741 /// ERROR_MULTIPLE_FAULT_VIOLATION
1092742 MULTIPLE_FAULT_VIOLATION = 640,
1093
1094743 /// The system is in the process of shutting down.
1095744 SYSTEM_SHUTDOWN = 641,
1096
1097745 /// An attempt to remove a processes DebugPort was made, but a port was not already associated with the process.
1098746 PORT_NOT_SET = 642,
1099
1100747 /// This version of Windows is not compatible with the behavior version of directory forest, domain or domain controller.
1101748 DS_VERSION_CHECK_FAILURE = 643,
1102
1103749 /// The specified range could not be found in the range list.
1104750 RANGE_NOT_FOUND = 644,
1105
1106751 /// The driver was not loaded because the system is booting into safe mode.
1107752 NOT_SAFE_MODE_DRIVER = 646,
1108
1109753 /// The driver was not loaded because it failed its initialization call.
1110754 FAILED_DRIVER_ENTRY = 647,
1111
1112755 /// The "%hs" encountered an error while applying power or reading the device configuration.
1113756 /// This may be caused by a failure of your hardware or by a poor connection.
1114757 DEVICE_ENUMERATION_ERROR = 648,
1115
1116758 /// The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached.
1117759 MOUNT_POINT_NOT_RESOLVED = 649,
1118
1119760 /// The device object parameter is either not a valid device object or is not attached to the volume specified by the file name.
1120761 INVALID_DEVICE_OBJECT_PARAMETER = 650,
1121
1122762 /// A Machine Check Error has occurred.
1123763 /// Please check the system eventlog for additional information.
1124764 MCA_OCCURED = 651,
1125
1126765 /// There was error [%2] processing the driver database.
1127766 DRIVER_DATABASE_ERROR = 652,
1128
1129767 /// System hive size has exceeded its limit.
1130768 SYSTEM_HIVE_TOO_LARGE = 653,
1131
1132769 /// The driver could not be loaded because a previous version of the driver is still in memory.
1133770 DRIVER_FAILED_PRIOR_UNLOAD = 654,
1134
1135771 /// {Volume Shadow Copy Service} Please wait while the Volume Shadow Copy Service prepares volume %hs for hibernation.
1136772 VOLSNAP_PREPARE_HIBERNATE = 655,
1137
1138773 /// The system has failed to hibernate (The error code is %hs).
1139774 /// Hibernation will be disabled until the system is restarted.
1140775 HIBERNATION_FAILURE = 656,
1141
1142776 /// The password provided is too long to meet the policy of your user account. Please choose a shorter password.
1143777 PWD_TOO_LONG = 657,
1144
1145778 /// The requested operation could not be completed due to a file system limitation.
1146779 FILE_SYSTEM_LIMITATION = 665,
1147
1148780 /// An assertion failure has occurred.
1149781 ASSERTION_FAILURE = 668,
1150
1151782 /// An error occurred in the ACPI subsystem.
1152783 ACPI_ERROR = 669,
1153
1154784 /// WOW Assertion Error.
1155785 WOW_ASSERTION = 670,
1156
1157786 /// A device is missing in the system BIOS MPS table. This device will not be used.
1158787 /// Please contact your system vendor for system BIOS update.
1159788 PNP_BAD_MPS_TABLE = 671,
1160
1161789 /// A translator failed to translate resources.
1162790 PNP_TRANSLATION_FAILED = 672,
1163
1164791 /// A IRQ translator failed to translate resources.
1165792 PNP_IRQ_TRANSLATION_FAILED = 673,
1166
1167793 /// Driver %2 returned invalid ID for a child device (%3).
1168794 PNP_INVALID_ID = 674,
1169
1170795 /// {Kernel Debugger Awakened} the system debugger was awakened by an interrupt.
1171796 WAKE_SYSTEM_DEBUGGER = 675,
1172
1173797 /// {Handles Closed} Handles to objects have been automatically closed as a result of the requested operation.
1174798 HANDLES_CLOSED = 676,
1175
1176799 /// {Too Much Information} The specified access control list (ACL) contained more information than was expected.
1177800 EXTRANEOUS_INFORMATION = 677,
1178
1179801 /// This warning level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted.
1180802 /// The commit has NOT been completed, but has not been rolled back either (so it may still be committed if desired).
1181803 RXACT_COMMIT_NECESSARY = 678,
1182
1183804 /// {Media Changed} The media may have changed.
1184805 MEDIA_CHECK = 679,
1185
1186806 /// {GUID Substitution} During the translation of a global identifier (GUID) to a Windows security ID (SID), no administratively-defined GUID prefix was found.
1187807 /// A substitute prefix was used, which will not compromise system security.
1188808 /// However, this may provide a more restrictive access than intended.
1189809 GUID_SUBSTITUTION_MADE = 680,
1190
1191810 /// The create operation stopped after reaching a symbolic link.
1192811 STOPPED_ON_SYMLINK = 681,
1193
1194812 /// A long jump has been executed.
1195813 LONGJUMP = 682,
1196
1197814 /// The Plug and Play query operation was not successful.
1198815 PLUGPLAY_QUERY_VETOED = 683,
1199
1200816 /// A frame consolidation has been executed.
1201817 UNWIND_CONSOLIDATE = 684,
1202
1203818 /// {Registry Hive Recovered} Registry hive (file): %hs was corrupted and it has been recovered. Some data might have been lost.
1204819 REGISTRY_HIVE_RECOVERED = 685,
1205
1206820 /// The application is attempting to run executable code from the module %hs. This may be insecure.
1207821 /// An alternative, %hs, is available. Should the application use the secure module %hs?
1208822 DLL_MIGHT_BE_INSECURE = 686,
1209
1210823 /// The application is loading executable code from the module %hs.
1211824 /// This is secure, but may be incompatible with previous releases of the operating system.
1212825 /// An alternative, %hs, is available. Should the application use the secure module %hs?
1213826 DLL_MIGHT_BE_INCOMPATIBLE = 687,
1214
1215827 /// Debugger did not handle the exception.
1216828 DBG_EXCEPTION_NOT_HANDLED = 688,
1217
1218829 /// Debugger will reply later.
1219830 DBG_REPLY_LATER = 689,
1220
1221831 /// Debugger cannot provide handle.
1222832 DBG_UNABLE_TO_PROVIDE_HANDLE = 690,
1223
1224833 /// Debugger terminated thread.
1225834 DBG_TERMINATE_THREAD = 691,
1226
1227835 /// Debugger terminated process.
1228836 DBG_TERMINATE_PROCESS = 692,
1229
1230837 /// Debugger got control C.
1231838 DBG_CONTROL_C = 693,
1232
1233839 /// Debugger printed exception on control C.
1234840 DBG_PRINTEXCEPTION_C = 694,
1235
1236841 /// Debugger received RIP exception.
1237842 DBG_RIPEXCEPTION = 695,
1238
1239843 /// Debugger received control break.
1240844 DBG_CONTROL_BREAK = 696,
1241
1242845 /// Debugger command communication exception.
1243846 DBG_COMMAND_EXCEPTION = 697,
1244
1245847 /// {Object Exists} An attempt was made to create an object and the object name already existed.
1246848 OBJECT_NAME_EXISTS = 698,
1247
1248849 /// {Thread Suspended} A thread termination occurred while the thread was suspended.
1249850 /// The thread was resumed, and termination proceeded.
1250851 THREAD_WAS_SUSPENDED = 699,
1251
1252852 /// {Image Relocated} An image file could not be mapped at the address specified in the image file. Local fixups must be performed on this image.
1253853 IMAGE_NOT_AT_BASE = 700,
1254
1255854 /// This informational level status indicates that a specified registry sub-tree transaction state did not yet exist and had to be created.
1256855 RXACT_STATE_CREATED = 701,
1257
1258856 /// {Segment Load} A virtual DOS machine (VDM) is loading, unloading, or moving an MS-DOS or Win16 program segment image.
1259857 /// An exception is raised so a debugger can load, unload or track symbols and breakpoints within these 16-bit segments.
1260858 SEGMENT_NOTIFICATION = 702,
1261
1262859 /// {Invalid Current Directory} The process cannot switch to the startup current directory %hs.
1263860 /// Select OK to set current directory to %hs, or select CANCEL to exit.
1264861 BAD_CURRENT_DIRECTORY = 703,
1265
1266862 /// {Redundant Read} To satisfy a read request, the NT fault-tolerant file system successfully read the requested data from a redundant copy.
1267863 /// This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was unable to reassign the failing area of the device.
1268864 FT_READ_RECOVERY_FROM_BACKUP = 704,
1269
1270865 /// {Redundant Write} To satisfy a write request, the NT fault-tolerant file system successfully wrote a redundant copy of the information.
1271866 /// This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was not able to reassign the failing area of the device.
1272867 FT_WRITE_RECOVERY = 705,
1273
1274868 /// {Machine Type Mismatch} The image file %hs is valid, but is for a machine type other than the current machine.
1275869 /// Select OK to continue, or CANCEL to fail the DLL load.
1276870 IMAGE_MACHINE_TYPE_MISMATCH = 706,
1277
1278871 /// {Partial Data Received} The network transport returned partial data to its client. The remaining data will be sent later.
1279872 RECEIVE_PARTIAL = 707,
1280
1281873 /// {Expedited Data Received} The network transport returned data to its client that was marked as expedited by the remote system.
1282874 RECEIVE_EXPEDITED = 708,
1283
1284875 /// {Partial Expedited Data Received} The network transport returned partial data to its client and this data was marked as expedited by the remote system. The remaining data will be sent later.
1285876 RECEIVE_PARTIAL_EXPEDITED = 709,
1286
1287877 /// {TDI Event Done} The TDI indication has completed successfully.
1288878 EVENT_DONE = 710,
1289
1290879 /// {TDI Event Pending} The TDI indication has entered the pending state.
1291880 EVENT_PENDING = 711,
1292
1293881 /// Checking file system on %wZ.
1294882 CHECKING_FILE_SYSTEM = 712,
1295
1296883 /// {Fatal Application Exit} %hs.
1297884 FATAL_APP_EXIT = 713,
1298
1299885 /// The specified registry key is referenced by a predefined handle.
1300886 PREDEFINED_HANDLE = 714,
1301
1302887 /// {Page Unlocked} The page protection of a locked page was changed to 'No Access' and the page was unlocked from memory and from the process.
1303888 WAS_UNLOCKED = 715,
1304
1305889 /// %hs
1306890 SERVICE_NOTIFICATION = 716,
1307
1308891 /// {Page Locked} One of the pages to lock was already locked.
1309892 WAS_LOCKED = 717,
1310
1311893 /// Application popup: %1 : %2
1312894 LOG_HARD_ERROR = 718,
1313
1314895 /// ERROR_ALREADY_WIN32
1315896 ALREADY_WIN32 = 719,
1316
1317897 /// {Machine Type Mismatch} The image file %hs is valid, but is for a machine type other than the current machine.
1318898 IMAGE_MACHINE_TYPE_MISMATCH_EXE = 720,
1319
1320899 /// A yield execution was performed and no thread was available to run.
1321900 NO_YIELD_PERFORMED = 721,
1322
1323901 /// The resumable flag to a timer API was ignored.
1324902 TIMER_RESUME_IGNORED = 722,
1325
1326903 /// The arbiter has deferred arbitration of these resources to its parent.
1327904 ARBITRATION_UNHANDLED = 723,
1328
1329905 /// The inserted CardBus device cannot be started because of a configuration error on "%hs".
1330906 CARDBUS_NOT_SUPPORTED = 724,
1331
1332907 /// The CPUs in this multiprocessor system are not all the same revision level.
1333908 /// To use all processors the operating system restricts itself to the features of the least capable processor in the system.
1334909 /// Should problems occur with this system, contact the CPU manufacturer to see if this mix of processors is supported.
1335910 MP_PROCESSOR_MISMATCH = 725,
1336
1337911 /// The system was put into hibernation.
1338912 HIBERNATED = 726,
1339
1340913 /// The system was resumed from hibernation.
1341914 RESUME_HIBERNATION = 727,
1342
1343915 /// Windows has detected that the system firmware (BIOS) was updated [previous firmware date = %2, current firmware date %3].
1344916 FIRMWARE_UPDATED = 728,
1345
1346917 /// A device driver is leaking locked I/O pages causing system degradation.
1347918 /// The system has automatically enabled tracking code in order to try and catch the culprit.
1348919 DRIVERS_LEAKING_LOCKED_PAGES = 729,
1349
1350920 /// The system has awoken.
1351921 WAKE_SYSTEM = 730,
1352
1353922 /// ERROR_WAIT_1
1354923 WAIT_1 = 731,
1355
1356924 /// ERROR_WAIT_2
1357925 WAIT_2 = 732,
1358
1359926 /// ERROR_WAIT_3
1360927 WAIT_3 = 733,
1361
1362928 /// ERROR_WAIT_63
1363929 WAIT_63 = 734,
1364
1365930 /// ERROR_ABANDONED_WAIT_0
1366931 ABANDONED_WAIT_0 = 735,
1367
1368932 /// ERROR_ABANDONED_WAIT_63
1369933 ABANDONED_WAIT_63 = 736,
1370
1371934 /// ERROR_USER_APC
1372935 USER_APC = 737,
1373
1374936 /// ERROR_KERNEL_APC
1375937 KERNEL_APC = 738,
1376
1377938 /// ERROR_ALERTED
1378939 ALERTED = 739,
1379
1380940 /// The requested operation requires elevation.
1381941 ELEVATION_REQUIRED = 740,
1382
1383942 /// A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link.
1384943 REPARSE = 741,
1385
1386944 /// An open/create operation completed while an oplock break is underway.
1387945 OPLOCK_BREAK_IN_PROGRESS = 742,
1388
1389946 /// A new volume has been mounted by a file system.
1390947 VOLUME_MOUNTED = 743,
1391
1392948 /// This success level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted. The commit has now been completed.
1393949 RXACT_COMMITTED = 744,
1394
1395950 /// This indicates that a notify change request has been completed due to closing the handle which made the notify change request.
1396951 NOTIFY_CLEANUP = 745,
1397
1398952 /// {Connect Failure on Primary Transport} An attempt was made to connect to the remote server %hs on the primary transport, but the connection failed.
1399953 /// The computer WAS able to connect on a secondary transport.
1400954 PRIMARY_TRANSPORT_CONNECT_FAILED = 746,
1401
1402955 /// Page fault was a transition fault.
1403956 PAGE_FAULT_TRANSITION = 747,
1404
1405957 /// Page fault was a demand zero fault.
1406958 PAGE_FAULT_DEMAND_ZERO = 748,
1407
1408959 /// Page fault was a demand zero fault.
1409960 PAGE_FAULT_COPY_ON_WRITE = 749,
1410
1411961 /// Page fault was a demand zero fault.
1412962 PAGE_FAULT_GUARD_PAGE = 750,
1413
1414963 /// Page fault was satisfied by reading from a secondary storage device.
1415964 PAGE_FAULT_PAGING_FILE = 751,
1416
1417965 /// Cached page was locked during operation.
1418966 CACHE_PAGE_LOCKED = 752,
1419
1420967 /// Crash dump exists in paging file.
1421968 CRASH_DUMP = 753,
1422
1423969 /// Specified buffer contains all zeros.
1424970 BUFFER_ALL_ZEROS = 754,
1425
1426971 /// A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link.
1427972 REPARSE_OBJECT = 755,
1428
1429973 /// The device has succeeded a query-stop and its resource requirements have changed.
1430974 RESOURCE_REQUIREMENTS_CHANGED = 756,
1431
1432975 /// The translator has translated these resources into the global space and no further translations should be performed.
1433976 TRANSLATION_COMPLETE = 757,
1434
1435977 /// A process being terminated has no threads to terminate.
1436978 NOTHING_TO_TERMINATE = 758,
1437
1438979 /// The specified process is not part of a job.
1439980 PROCESS_NOT_IN_JOB = 759,
1440
1441981 /// The specified process is part of a job.
1442982 PROCESS_IN_JOB = 760,
1443
1444983 /// {Volume Shadow Copy Service} The system is now ready for hibernation.
1445984 VOLSNAP_HIBERNATE_READY = 761,
1446
1447985 /// A file system or file system filter driver has successfully completed an FsFilter operation.
1448986 FSFILTER_OP_COMPLETED_SUCCESSFULLY = 762,
1449
1450987 /// The specified interrupt vector was already connected.
1451988 INTERRUPT_VECTOR_ALREADY_CONNECTED = 763,
1452
1453989 /// The specified interrupt vector is still connected.
1454990 INTERRUPT_STILL_CONNECTED = 764,
1455
1456991 /// An operation is blocked waiting for an oplock.
1457992 WAIT_FOR_OPLOCK = 765,
1458
1459993 /// Debugger handled exception.
1460994 DBG_EXCEPTION_HANDLED = 766,
1461
1462995 /// Debugger continued.
1463996 DBG_CONTINUE = 767,
1464
1465997 /// An exception occurred in a user mode callback and the kernel callback frame should be removed.
1466998 CALLBACK_POP_STACK = 768,
1467
1468999 /// Compression is disabled for this volume.
14691000 COMPRESSION_DISABLED = 769,
1470
14711001 /// The data provider cannot fetch backwards through a result set.
14721002 CANTFETCHBACKWARDS = 770,
1473
14741003 /// The data provider cannot scroll backwards through a result set.
14751004 CANTSCROLLBACKWARDS = 771,
1476
14771005 /// The data provider requires that previously fetched data is released before asking for more data.
14781006 ROWSNOTRELEASED = 772,
1479
14801007 /// The data provider was not able to interpret the flags set for a column binding in an accessor.
14811008 BAD_ACCESSOR_FLAGS = 773,
1482
14831009 /// One or more errors occurred while processing the request.
14841010 ERRORS_ENCOUNTERED = 774,
1485
14861011 /// The implementation is not capable of performing the request.
14871012 NOT_CAPABLE = 775,
1488
14891013 /// The client of a component requested an operation which is not valid given the state of the component instance.
14901014 REQUEST_OUT_OF_SEQUENCE = 776,
1491
14921015 /// A version number could not be parsed.
14931016 VERSION_PARSE_ERROR = 777,
1494
14951017 /// The iterator's start position is invalid.
14961018 BADSTARTPOSITION = 778,
1497
14981019 /// The hardware has reported an uncorrectable memory error.
14991020 MEMORY_HARDWARE = 779,
1500
15011021 /// The attempted operation required self healing to be enabled.
15021022 DISK_REPAIR_DISABLED = 780,
1503
15041023 /// The Desktop heap encountered an error while allocating session memory.
15051024 /// There is more information in the system event log.
15061025 INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE = 781,
1507
15081026 /// The system power state is transitioning from %2 to %3.
15091027 SYSTEM_POWERSTATE_TRANSITION = 782,
1510
15111028 /// The system power state is transitioning from %2 to %3 but could enter %4.
15121029 SYSTEM_POWERSTATE_COMPLEX_TRANSITION = 783,
1513
15141030 /// A thread is getting dispatched with MCA EXCEPTION because of MCA.
15151031 MCA_EXCEPTION = 784,
1516
15171032 /// Access to %1 is monitored by policy rule %2.
15181033 ACCESS_AUDIT_BY_POLICY = 785,
1519
15201034 /// Access to %1 has been restricted by your Administrator by policy rule %2.
15211035 ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY = 786,
1522
15231036 /// A valid hibernation file has been invalidated and should be abandoned.
15241037 ABANDON_HIBERFILE = 787,
1525
15261038 /// {Delayed Write Failed} Windows was unable to save all the data for the file %hs; the data has been lost.
15271039 /// This error may be caused by network connectivity issues. Please try to save this file elsewhere.
15281040 LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED = 788,
1529
15301041 /// {Delayed Write Failed} Windows was unable to save all the data for the file %hs; the data has been lost.
15311042 /// This error was returned by the server on which the file exists. Please try to save this file elsewhere.
15321043 LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR = 789,
1533
15341044 /// {Delayed Write Failed} Windows was unable to save all the data for the file %hs; the data has been lost.
15351045 /// This error may be caused if the device has been removed or the media is write-protected.
15361046 LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR = 790,
1537
15381047 /// The resources required for this device conflict with the MCFG table.
15391048 BAD_MCFG_TABLE = 791,
1540
15411049 /// The volume repair could not be performed while it is online.
15421050 /// Please schedule to take the volume offline so that it can be repaired.
15431051 DISK_REPAIR_REDIRECTED = 792,
1544
15451052 /// The volume repair was not successful.
15461053 DISK_REPAIR_UNSUCCESSFUL = 793,
1547
15481054 /// One of the volume corruption logs is full.
15491055 /// Further corruptions that may be detected won't be logged.
15501056 CORRUPT_LOG_OVERFULL = 794,
1551
15521057 /// One of the volume corruption logs is internally corrupted and needs to be recreated.
15531058 /// The volume may contain undetected corruptions and must be scanned.
15541059 CORRUPT_LOG_CORRUPTED = 795,
1555
15561060 /// One of the volume corruption logs is unavailable for being operated on.
15571061 CORRUPT_LOG_UNAVAILABLE = 796,
1558
15591062 /// One of the volume corruption logs was deleted while still having corruption records in them.
15601063 /// The volume contains detected corruptions and must be scanned.
15611064 CORRUPT_LOG_DELETED_FULL = 797,
1562
15631065 /// One of the volume corruption logs was cleared by chkdsk and no longer contains real corruptions.
15641066 CORRUPT_LOG_CLEARED = 798,
1565
15661067 /// Orphaned files exist on the volume but could not be recovered because no more new names could be created in the recovery directory. Files must be moved from the recovery directory.
15671068 ORPHAN_NAME_EXHAUSTED = 799,
1568
15691069 /// The oplock that was associated with this handle is now associated with a different handle.
15701070 OPLOCK_SWITCHED_TO_NEW_HANDLE = 800,
1571
15721071 /// An oplock of the requested level cannot be granted. An oplock of a lower level may be available.
15731072 CANNOT_GRANT_REQUESTED_OPLOCK = 801,
1574
15751073 /// The operation did not complete successfully because it would cause an oplock to be broken.
15761074 /// The caller has requested that existing oplocks not be broken.
15771075 CANNOT_BREAK_OPLOCK = 802,
1578
15791076 /// The handle with which this oplock was associated has been closed. The oplock is now broken.
15801077 OPLOCK_HANDLE_CLOSED = 803,
1581
15821078 /// The specified access control entry (ACE) does not contain a condition.
15831079 NO_ACE_CONDITION = 804,
1584
15851080 /// The specified access control entry (ACE) contains an invalid condition.
15861081 INVALID_ACE_CONDITION = 805,
1587
15881082 /// Access to the specified file handle has been revoked.
15891083 FILE_HANDLE_REVOKED = 806,
1590
15911084 /// An image file was mapped at a different address from the one specified in the image file but fixups will still be automatically performed on the image.
15921085 IMAGE_AT_DIFFERENT_BASE = 807,
1593
15941086 /// Access to the extended attribute was denied.
15951087 EA_ACCESS_DENIED = 994,
1596
15971088 /// The I/O operation has been aborted because of either a thread exit or an application request.
15981089 OPERATION_ABORTED = 995,
1599
16001090 /// Overlapped I/O event is not in a signaled state.
16011091 IO_INCOMPLETE = 996,
1602
16031092 /// Overlapped I/O operation is in progress.
16041093 IO_PENDING = 997,
1605
16061094 /// Invalid access to memory location.
16071095 NOACCESS = 998,
1608
16091096 /// Error performing inpage operation.
16101097 SWAPERROR = 999,
1611
16121098 /// Recursion too deep; the stack overflowed.
16131099 STACK_OVERFLOW = 1001,
1614
16151100 /// The window cannot act on the sent message.
16161101 INVALID_MESSAGE = 1002,
1617
16181102 /// Cannot complete this function.
16191103 CAN_NOT_COMPLETE = 1003,
1620
16211104 /// Invalid flags.
16221105 INVALID_FLAGS = 1004,
1623
16241106 /// The volume does not contain a recognized file system.
16251107 /// Please make sure that all required file system drivers are loaded and that the volume is not corrupted.
16261108 UNRECOGNIZED_VOLUME = 1005,
1627
16281109 /// The volume for a file has been externally altered so that the opened file is no longer valid.
16291110 FILE_INVALID = 1006,
1630
16311111 /// The requested operation cannot be performed in full-screen mode.
16321112 FULLSCREEN_MODE = 1007,
1633
16341113 /// An attempt was made to reference a token that does not exist.
16351114 NO_TOKEN = 1008,
1636
16371115 /// The configuration registry database is corrupt.
16381116 BADDB = 1009,
1639
16401117 /// The configuration registry key is invalid.
16411118 BADKEY = 1010,
1642
16431119 /// The configuration registry key could not be opened.
16441120 CANTOPEN = 1011,
1645
16461121 /// The configuration registry key could not be read.
16471122 CANTREAD = 1012,
1648
16491123 /// The configuration registry key could not be written.
16501124 CANTWRITE = 1013,
1651
16521125 /// One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful.
16531126 REGISTRY_RECOVERED = 1014,
1654
16551127 /// The registry is corrupted. The structure of one of the files containing registry data is corrupted, or the system's memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted.
16561128 REGISTRY_CORRUPT = 1015,
1657
16581129 /// An I/O operation initiated by the registry failed unrecoverably.
16591130 /// The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry.
16601131 REGISTRY_IO_FAILED = 1016,
1661
16621132 /// The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format.
16631133 NOT_REGISTRY_FILE = 1017,
1664
16651134 /// Illegal operation attempted on a registry key that has been marked for deletion.
16661135 KEY_DELETED = 1018,
1667
16681136 /// System could not allocate the required space in a registry log.
16691137 NO_LOG_SPACE = 1019,
1670
16711138 /// Cannot create a symbolic link in a registry key that already has subkeys or values.
16721139 KEY_HAS_CHILDREN = 1020,
1673
16741140 /// Cannot create a stable subkey under a volatile parent key.
16751141 CHILD_MUST_BE_VOLATILE = 1021,
1676
16771142 /// A notify change request is being completed and the information is not being returned in the caller's buffer.
16781143 /// The caller now needs to enumerate the files to find the changes.
16791144 NOTIFY_ENUM_DIR = 1022,
1680
16811145 /// A stop control has been sent to a service that other running services are dependent on.
16821146 DEPENDENT_SERVICES_RUNNING = 1051,
1683
16841147 /// The requested control is not valid for this service.
16851148 INVALID_SERVICE_CONTROL = 1052,
1686
16871149 /// The service did not respond to the start or control request in a timely fashion.
16881150 SERVICE_REQUEST_TIMEOUT = 1053,
1689
16901151 /// A thread could not be created for the service.
16911152 SERVICE_NO_THREAD = 1054,
1692
16931153 /// The service database is locked.
16941154 SERVICE_DATABASE_LOCKED = 1055,
1695
16961155 /// An instance of the service is already running.
16971156 SERVICE_ALREADY_RUNNING = 1056,
1698
16991157 /// The account name is invalid or does not exist, or the password is invalid for the account name specified.
17001158 INVALID_SERVICE_ACCOUNT = 1057,
1701
17021159 /// The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
17031160 SERVICE_DISABLED = 1058,
1704
17051161 /// Circular service dependency was specified.
17061162 CIRCULAR_DEPENDENCY = 1059,
1707
17081163 /// The specified service does not exist as an installed service.
17091164 SERVICE_DOES_NOT_EXIST = 1060,
1710
17111165 /// The service cannot accept control messages at this time.
17121166 SERVICE_CANNOT_ACCEPT_CTRL = 1061,
1713
17141167 /// The service has not been started.
17151168 SERVICE_NOT_ACTIVE = 1062,
1716
17171169 /// The service process could not connect to the service controller.
17181170 FAILED_SERVICE_CONTROLLER_CONNECT = 1063,
1719
17201171 /// An exception occurred in the service when handling the control request.
17211172 EXCEPTION_IN_SERVICE = 1064,
1722
17231173 /// The database specified does not exist.
17241174 DATABASE_DOES_NOT_EXIST = 1065,
1725
17261175 /// The service has returned a service-specific error code.
17271176 SERVICE_SPECIFIC_ERROR = 1066,
1728
17291177 /// The process terminated unexpectedly.
17301178 PROCESS_ABORTED = 1067,
1731
17321179 /// The dependency service or group failed to start.
17331180 SERVICE_DEPENDENCY_FAIL = 1068,
1734
17351181 /// The service did not start due to a logon failure.
17361182 SERVICE_LOGON_FAILED = 1069,
1737
17381183 /// After starting, the service hung in a start-pending state.
17391184 SERVICE_START_HANG = 1070,
1740
17411185 /// The specified service database lock is invalid.
17421186 INVALID_SERVICE_LOCK = 1071,
1743
17441187 /// The specified service has been marked for deletion.
17451188 SERVICE_MARKED_FOR_DELETE = 1072,
1746
17471189 /// The specified service already exists.
17481190 SERVICE_EXISTS = 1073,
1749
17501191 /// The system is currently running with the last-known-good configuration.
17511192 ALREADY_RUNNING_LKG = 1074,
1752
17531193 /// The dependency service does not exist or has been marked for deletion.
17541194 SERVICE_DEPENDENCY_DELETED = 1075,
1755
17561195 /// The current boot has already been accepted for use as the last-known-good control set.
17571196 BOOT_ALREADY_ACCEPTED = 1076,
1758
17591197 /// No attempts to start the service have been made since the last boot.
17601198 SERVICE_NEVER_STARTED = 1077,
1761
17621199 /// The name is already in use as either a service name or a service display name.
17631200 DUPLICATE_SERVICE_NAME = 1078,
1764
17651201 /// The account specified for this service is different from the account specified for other services running in the same process.
17661202 DIFFERENT_SERVICE_ACCOUNT = 1079,
1767
17681203 /// Failure actions can only be set for Win32 services, not for drivers.
17691204 CANNOT_DETECT_DRIVER_FAILURE = 1080,
1770
17711205 /// This service runs in the same process as the service control manager.
17721206 /// Therefore, the service control manager cannot take action if this service's process terminates unexpectedly.
17731207 CANNOT_DETECT_PROCESS_ABORT = 1081,
1774
17751208 /// No recovery program has been configured for this service.
17761209 NO_RECOVERY_PROGRAM = 1082,
1777
17781210 /// The executable program that this service is configured to run in does not implement the service.
17791211 SERVICE_NOT_IN_EXE = 1083,
1780
17811212 /// This service cannot be started in Safe Mode.
17821213 NOT_SAFEBOOT_SERVICE = 1084,
1783
17841214 /// The physical end of the tape has been reached.
17851215 END_OF_MEDIA = 1100,
1786
17871216 /// A tape access reached a filemark.
17881217 FILEMARK_DETECTED = 1101,
1789
17901218 /// The beginning of the tape or a partition was encountered.
17911219 BEGINNING_OF_MEDIA = 1102,
1792
17931220 /// A tape access reached the end of a set of files.
17941221 SETMARK_DETECTED = 1103,
1795
17961222 /// No more data is on the tape.
17971223 NO_DATA_DETECTED = 1104,
1798
17991224 /// Tape could not be partitioned.
18001225 PARTITION_FAILURE = 1105,
1801
18021226 /// When accessing a new tape of a multivolume partition, the current block size is incorrect.
18031227 INVALID_BLOCK_LENGTH = 1106,
1804
18051228 /// Tape partition information could not be found when loading a tape.
18061229 DEVICE_NOT_PARTITIONED = 1107,
1807
18081230 /// Unable to lock the media eject mechanism.
18091231 UNABLE_TO_LOCK_MEDIA = 1108,
1810
18111232 /// Unable to unload the media.
18121233 UNABLE_TO_UNLOAD_MEDIA = 1109,
1813
18141234 /// The media in the drive may have changed.
18151235 MEDIA_CHANGED = 1110,
1816
18171236 /// The I/O bus was reset.
18181237 BUS_RESET = 1111,
1819
18201238 /// No media in drive.
18211239 NO_MEDIA_IN_DRIVE = 1112,
1822
18231240 /// No mapping for the Unicode character exists in the target multi-byte code page.
18241241 NO_UNICODE_TRANSLATION = 1113,
1825
18261242 /// A dynamic link library (DLL) initialization routine failed.
18271243 DLL_INIT_FAILED = 1114,
1828
18291244 /// A system shutdown is in progress.
18301245 SHUTDOWN_IN_PROGRESS = 1115,
1831
18321246 /// Unable to abort the system shutdown because no shutdown was in progress.
18331247 NO_SHUTDOWN_IN_PROGRESS = 1116,
1834
18351248 /// The request could not be performed because of an I/O device error.
18361249 IO_DEVICE = 1117,
1837
18381250 /// No serial device was successfully initialized. The serial driver will unload.
18391251 SERIAL_NO_DEVICE = 1118,
1840
18411252 /// Unable to open a device that was sharing an interrupt request (IRQ) with other devices.
18421253 /// At least one other device that uses that IRQ was already opened.
18431254 IRQ_BUSY = 1119,
1844
18451255 /// A serial I/O operation was completed by another write to the serial port. The IOCTL_SERIAL_XOFF_COUNTER reached zero.)
18461256 MORE_WRITES = 1120,
1847
18481257 /// A serial I/O operation completed because the timeout period expired.
18491258 /// The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
18501259 COUNTER_TIMEOUT = 1121,
1851
18521260 /// No ID address mark was found on the floppy disk.
18531261 FLOPPY_ID_MARK_NOT_FOUND = 1122,
1854
18551262 /// Mismatch between the floppy disk sector ID field and the floppy disk controller track address.
18561263 FLOPPY_WRONG_CYLINDER = 1123,
1857
18581264 /// The floppy disk controller reported an error that is not recognized by the floppy disk driver.
18591265 FLOPPY_UNKNOWN_ERROR = 1124,
1860
18611266 /// The floppy disk controller returned inconsistent results in its registers.
18621267 FLOPPY_BAD_REGISTERS = 1125,
1863
18641268 /// While accessing the hard disk, a recalibrate operation failed, even after retries.
18651269 DISK_RECALIBRATE_FAILED = 1126,
1866
18671270 /// While accessing the hard disk, a disk operation failed even after retries.
18681271 DISK_OPERATION_FAILED = 1127,
1869
18701272 /// While accessing the hard disk, a disk controller reset was needed, but even that failed.
18711273 DISK_RESET_FAILED = 1128,
1872
18731274 /// Physical end of tape encountered.
18741275 EOM_OVERFLOW = 1129,
1875
18761276 /// Not enough server storage is available to process this command.
18771277 NOT_ENOUGH_SERVER_MEMORY = 1130,
1878
18791278 /// A potential deadlock condition has been detected.
18801279 POSSIBLE_DEADLOCK = 1131,
1881
18821280 /// The base address or the file offset specified does not have the proper alignment.
18831281 MAPPED_ALIGNMENT = 1132,
1884
18851282 /// An attempt to change the system power state was vetoed by another application or driver.
18861283 SET_POWER_STATE_VETOED = 1140,
1887
18881284 /// The system BIOS failed an attempt to change the system power state.
18891285 SET_POWER_STATE_FAILED = 1141,
1890
18911286 /// An attempt was made to create more links on a file than the file system supports.
18921287 TOO_MANY_LINKS = 1142,
1893
18941288 /// The specified program requires a newer version of Windows.
18951289 OLD_WIN_VERSION = 1150,
1896
18971290 /// The specified program is not a Windows or MS-DOS program.
18981291 APP_WRONG_OS = 1151,
1899
19001292 /// Cannot start more than one instance of the specified program.
19011293 SINGLE_INSTANCE_APP = 1152,
1902
19031294 /// The specified program was written for an earlier version of Windows.
19041295 RMODE_APP = 1153,
1905
19061296 /// One of the library files needed to run this application is damaged.
19071297 INVALID_DLL = 1154,
1908
19091298 /// No application is associated with the specified file for this operation.
19101299 NO_ASSOCIATION = 1155,
1911
19121300 /// An error occurred in sending the command to the application.
19131301 DDE_FAIL = 1156,
1914
19151302 /// One of the library files needed to run this application cannot be found.
19161303 DLL_NOT_FOUND = 1157,
1917
19181304 /// The current process has used all of its system allowance of handles for Window Manager objects.
19191305 NO_MORE_USER_HANDLES = 1158,
1920
19211306 /// The message can be used only with synchronous operations.
19221307 MESSAGE_SYNC_ONLY = 1159,
1923
19241308 /// The indicated source element has no media.
19251309 SOURCE_ELEMENT_EMPTY = 1160,
1926
19271310 /// The indicated destination element already contains media.
19281311 DESTINATION_ELEMENT_FULL = 1161,
1929
19301312 /// The indicated element does not exist.
19311313 ILLEGAL_ELEMENT_ADDRESS = 1162,
1932
19331314 /// The indicated element is part of a magazine that is not present.
19341315 MAGAZINE_NOT_PRESENT = 1163,
1935
19361316 /// The indicated device requires reinitialization due to hardware errors.
19371317 DEVICE_REINITIALIZATION_NEEDED = 1164,
1938
19391318 /// The device has indicated that cleaning is required before further operations are attempted.
19401319 DEVICE_REQUIRES_CLEANING = 1165,
1941
19421320 /// The device has indicated that its door is open.
19431321 DEVICE_DOOR_OPEN = 1166,
1944
19451322 /// The device is not connected.
19461323 DEVICE_NOT_CONNECTED = 1167,
1947
19481324 /// Element not found.
19491325 NOT_FOUND = 1168,
1950
19511326 /// There was no match for the specified key in the index.
19521327 NO_MATCH = 1169,
1953
19541328 /// The property set specified does not exist on the object.
19551329 SET_NOT_FOUND = 1170,
1956
19571330 /// The point passed to GetMouseMovePoints is not in the buffer.
19581331 POINT_NOT_FOUND = 1171,
1959
19601332 /// The tracking (workstation) service is not running.
19611333 NO_TRACKING_SERVICE = 1172,
1962
19631334 /// The Volume ID could not be found.
19641335 NO_VOLUME_ID = 1173,
1965
19661336 /// Unable to remove the file to be replaced.
19671337 UNABLE_TO_REMOVE_REPLACED = 1175,
1968
19691338 /// Unable to move the replacement file to the file to be replaced.
19701339 /// The file to be replaced has retained its original name.
19711340 UNABLE_TO_MOVE_REPLACEMENT = 1176,
1972
19731341 /// Unable to move the replacement file to the file to be replaced.
19741342 /// The file to be replaced has been renamed using the backup name.
19751343 UNABLE_TO_MOVE_REPLACEMENT_2 = 1177,
1976
19771344 /// The volume change journal is being deleted.
19781345 JOURNAL_DELETE_IN_PROGRESS = 1178,
1979
19801346 /// The volume change journal is not active.
19811347 JOURNAL_NOT_ACTIVE = 1179,
1982
19831348 /// A file was found, but it may not be the correct file.
19841349 POTENTIAL_FILE_FOUND = 1180,
1985
19861350 /// The journal entry has been deleted from the journal.
19871351 JOURNAL_ENTRY_DELETED = 1181,
1988
19891352 /// A system shutdown has already been scheduled.
19901353 SHUTDOWN_IS_SCHEDULED = 1190,
1991
19921354 /// The system shutdown cannot be initiated because there are other users logged on to the computer.
19931355 SHUTDOWN_USERS_LOGGED_ON = 1191,
1994
19951356 /// The specified device name is invalid.
19961357 BAD_DEVICE = 1200,
1997
19981358 /// The device is not currently connected but it is a remembered connection.
19991359 CONNECTION_UNAVAIL = 1201,
2000
20011360 /// The local device name has a remembered connection to another network resource.
20021361 DEVICE_ALREADY_REMEMBERED = 1202,
2003
20041362 /// The network path was either typed incorrectly, does not exist, or the network provider is not currently available.
20051363 /// Please try retyping the path or contact your network administrator.
20061364 NO_NET_OR_BAD_PATH = 1203,
2007
20081365 /// The specified network provider name is invalid.
20091366 BAD_PROVIDER = 1204,
2010
20111367 /// Unable to open the network connection profile.
20121368 CANNOT_OPEN_PROFILE = 1205,
2013
20141369 /// The network connection profile is corrupted.
20151370 BAD_PROFILE = 1206,
2016
20171371 /// Cannot enumerate a noncontainer.
20181372 NOT_CONTAINER = 1207,
2019
20201373 /// An extended error has occurred.
20211374 EXTENDED_ERROR = 1208,
2022
20231375 /// The format of the specified group name is invalid.
20241376 INVALID_GROUPNAME = 1209,
2025
20261377 /// The format of the specified computer name is invalid.
20271378 INVALID_COMPUTERNAME = 1210,
2028
20291379 /// The format of the specified event name is invalid.
20301380 INVALID_EVENTNAME = 1211,
2031
20321381 /// The format of the specified domain name is invalid.
20331382 INVALID_DOMAINNAME = 1212,
2034
20351383 /// The format of the specified service name is invalid.
20361384 INVALID_SERVICENAME = 1213,
2037
20381385 /// The format of the specified network name is invalid.
20391386 INVALID_NETNAME = 1214,
2040
20411387 /// The format of the specified share name is invalid.
20421388 INVALID_SHARENAME = 1215,
2043
20441389 /// The format of the specified password is invalid.
20451390 INVALID_PASSWORDNAME = 1216,
2046
20471391 /// The format of the specified message name is invalid.
20481392 INVALID_MESSAGENAME = 1217,
2049
20501393 /// The format of the specified message destination is invalid.
20511394 INVALID_MESSAGEDEST = 1218,
2052
20531395 /// Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed.
20541396 /// Disconnect all previous connections to the server or shared resource and try again.
20551397 SESSION_CREDENTIAL_CONFLICT = 1219,
2056
20571398 /// An attempt was made to establish a session to a network server, but there are already too many sessions established to that server.
20581399 REMOTE_SESSION_LIMIT_EXCEEDED = 1220,
2059
20601400 /// The workgroup or domain name is already in use by another computer on the network.
20611401 DUP_DOMAINNAME = 1221,
2062
20631402 /// The network is not present or not started.
20641403 NO_NETWORK = 1222,
2065
20661404 /// The operation was canceled by the user.
20671405 CANCELLED = 1223,
2068
20691406 /// The requested operation cannot be performed on a file with a user-mapped section open.
20701407 USER_MAPPED_FILE = 1224,
2071
20721408 /// The remote computer refused the network connection.
20731409 CONNECTION_REFUSED = 1225,
2074
20751410 /// The network connection was gracefully closed.
20761411 GRACEFUL_DISCONNECT = 1226,
2077
20781412 /// The network transport endpoint already has an address associated with it.
20791413 ADDRESS_ALREADY_ASSOCIATED = 1227,
2080
20811414 /// An address has not yet been associated with the network endpoint.
20821415 ADDRESS_NOT_ASSOCIATED = 1228,
2083
20841416 /// An operation was attempted on a nonexistent network connection.
20851417 CONNECTION_INVALID = 1229,
2086
20871418 /// An invalid operation was attempted on an active network connection.
20881419 CONNECTION_ACTIVE = 1230,
2089
20901420 /// The network location cannot be reached.
20911421 /// For information about network troubleshooting, see Windows Help.
20921422 NETWORK_UNREACHABLE = 1231,
2093
20941423 /// The network location cannot be reached.
20951424 /// For information about network troubleshooting, see Windows Help.
20961425 HOST_UNREACHABLE = 1232,
2097
20981426 /// The network location cannot be reached.
20991427 /// For information about network troubleshooting, see Windows Help.
21001428 PROTOCOL_UNREACHABLE = 1233,
2101
21021429 /// No service is operating at the destination network endpoint on the remote system.
21031430 PORT_UNREACHABLE = 1234,
2104
21051431 /// The request was aborted.
21061432 REQUEST_ABORTED = 1235,
2107
21081433 /// The network connection was aborted by the local system.
21091434 CONNECTION_ABORTED = 1236,
2110
21111435 /// The operation could not be completed. A retry should be performed.
21121436 RETRY = 1237,
2113
21141437 /// A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached.
21151438 CONNECTION_COUNT_LIMIT = 1238,
2116
21171439 /// Attempting to log in during an unauthorized time of day for this account.
21181440 LOGIN_TIME_RESTRICTION = 1239,
2119
21201441 /// The account is not authorized to log in from this station.
21211442 LOGIN_WKSTA_RESTRICTION = 1240,
2122
21231443 /// The network address could not be used for the operation requested.
21241444 INCORRECT_ADDRESS = 1241,
2125
21261445 /// The service is already registered.
21271446 ALREADY_REGISTERED = 1242,
2128
21291447 /// The specified service does not exist.
21301448 SERVICE_NOT_FOUND = 1243,
2131
21321449 /// The operation being requested was not performed because the user has not been authenticated.
21331450 NOT_AUTHENTICATED = 1244,
2134
21351451 /// The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist.
21361452 NOT_LOGGED_ON = 1245,
2137
21381453 /// Continue with work in progress.
21391454 CONTINUE = 1246,
2140
21411455 /// An attempt was made to perform an initialization operation when initialization has already been completed.
21421456 ALREADY_INITIALIZED = 1247,
2143
21441457 /// No more local devices.
21451458 NO_MORE_DEVICES = 1248,
2146
21471459 /// The specified site does not exist.
21481460 NO_SUCH_SITE = 1249,
2149
21501461 /// A domain controller with the specified name already exists.
21511462 DOMAIN_CONTROLLER_EXISTS = 1250,
2152
21531463 /// This operation is supported only when you are connected to the server.
21541464 ONLY_IF_CONNECTED = 1251,
2155
21561465 /// The group policy framework should call the extension even if there are no changes.
21571466 OVERRIDE_NOCHANGES = 1252,
2158
21591467 /// The specified user does not have a valid profile.
21601468 BAD_USER_PROFILE = 1253,
2161
21621469 /// This operation is not supported on a computer running Windows Server 2003 for Small Business Server.
21631470 NOT_SUPPORTED_ON_SBS = 1254,
2164
21651471 /// The server machine is shutting down.
21661472 SERVER_SHUTDOWN_IN_PROGRESS = 1255,
2167
21681473 /// The remote system is not available.
21691474 /// For information about network troubleshooting, see Windows Help.
21701475 HOST_DOWN = 1256,
2171
21721476 /// The security identifier provided is not from an account domain.
21731477 NON_ACCOUNT_SID = 1257,
2174
21751478 /// The security identifier provided does not have a domain component.
21761479 NON_DOMAIN_SID = 1258,
2177
21781480 /// AppHelp dialog canceled thus preventing the application from starting.
21791481 APPHELP_BLOCK = 1259,
2180
21811482 /// This program is blocked by group policy.
21821483 /// For more information, contact your system administrator.
21831484 ACCESS_DISABLED_BY_POLICY = 1260,
2184
21851485 /// A program attempt to use an invalid register value.
21861486 /// Normally caused by an uninitialized register. This error is Itanium specific.
21871487 REG_NAT_CONSUMPTION = 1261,
2188
21891488 /// The share is currently offline or does not exist.
21901489 CSCSHARE_OFFLINE = 1262,
2191
21921490 /// The Kerberos protocol encountered an error while validating the KDC certificate during smartcard logon.
21931491 /// There is more information in the system event log.
21941492 PKINIT_FAILURE = 1263,
2195
21961493 /// The Kerberos protocol encountered an error while attempting to utilize the smartcard subsystem.
21971494 SMARTCARD_SUBSYSTEM_FAILURE = 1264,
2198
21991495 /// The system cannot contact a domain controller to service the authentication request. Please try again later.
22001496 DOWNGRADE_DETECTED = 1265,
2201
22021497 /// The machine is locked and cannot be shut down without the force option.
22031498 MACHINE_LOCKED = 1271,
2204
22051499 /// An application-defined callback gave invalid data when called.
22061500 CALLBACK_SUPPLIED_INVALID_DATA = 1273,
2207
22081501 /// The group policy framework should call the extension in the synchronous foreground policy refresh.
22091502 SYNC_FOREGROUND_REFRESH_REQUIRED = 1274,
2210
22111503 /// This driver has been blocked from loading.
22121504 DRIVER_BLOCKED = 1275,
2213
22141505 /// A dynamic link library (DLL) referenced a module that was neither a DLL nor the process's executable image.
22151506 INVALID_IMPORT_OF_NON_DLL = 1276,
2216
22171507 /// Windows cannot open this program since it has been disabled.
22181508 ACCESS_DISABLED_WEBBLADE = 1277,
2219
22201509 /// Windows cannot open this program because the license enforcement system has been tampered with or become corrupted.
22211510 ACCESS_DISABLED_WEBBLADE_TAMPER = 1278,
2222
22231511 /// A transaction recover failed.
22241512 RECOVERY_FAILURE = 1279,
2225
22261513 /// The current thread has already been converted to a fiber.
22271514 ALREADY_FIBER = 1280,
2228
22291515 /// The current thread has already been converted from a fiber.
22301516 ALREADY_THREAD = 1281,
2231
22321517 /// The system detected an overrun of a stack-based buffer in this application.
22331518 /// This overrun could potentially allow a malicious user to gain control of this application.
22341519 STACK_BUFFER_OVERRUN = 1282,
2235
22361520 /// Data present in one of the parameters is more than the function can operate on.
22371521 PARAMETER_QUOTA_EXCEEDED = 1283,
2238
22391522 /// An attempt to do an operation on a debug object failed because the object is in the process of being deleted.
22401523 DEBUGGER_INACTIVE = 1284,
2241
22421524 /// An attempt to delay-load a .dll or get a function address in a delay-loaded .dll failed.
22431525 DELAY_LOAD_FAILED = 1285,
2244
22451526 /// %1 is a 16-bit application. You do not have permissions to execute 16-bit applications.
22461527 /// Check your permissions with your system administrator.
22471528 VDM_DISALLOWED = 1286,
2248
22491529 /// Insufficient information exists to identify the cause of failure.
22501530 UNIDENTIFIED_ERROR = 1287,
2251
22521531 /// The parameter passed to a C runtime function is incorrect.
22531532 INVALID_CRUNTIME_PARAMETER = 1288,
2254
22551533 /// The operation occurred beyond the valid data length of the file.
22561534 BEYOND_VDL = 1289,
2257
22581535 /// The service start failed since one or more services in the same process have an incompatible service SID type setting.
22591536 /// A service with restricted service SID type can only coexist in the same process with other services with a restricted SID type.
22601537 /// If the service SID type for this service was just configured, the hosting process must be restarted in order to start this service.
22611538 /// On Windows Server 2003 and Windows XP, an unrestricted service cannot coexist in the same process with other services.
22621539 /// The service with the unrestricted service SID type must be moved to an owned process in order to start this service.
22631540 INCOMPATIBLE_SERVICE_SID_TYPE = 1290,
2264
22651541 /// The process hosting the driver for this device has been terminated.
22661542 DRIVER_PROCESS_TERMINATED = 1291,
2267
22681543 /// An operation attempted to exceed an implementation-defined limit.
22691544 IMPLEMENTATION_LIMIT = 1292,
2270
22711545 /// Either the target process, or the target thread's containing process, is a protected process.
22721546 PROCESS_IS_PROTECTED = 1293,
2273
22741547 /// The service notification client is lagging too far behind the current state of services in the machine.
22751548 SERVICE_NOTIFY_CLIENT_LAGGING = 1294,
2276
22771549 /// The requested file operation failed because the storage quota was exceeded.
22781550 /// To free up disk space, move files to a different location or delete unnecessary files.
22791551 /// For more information, contact your system administrator.
22801552 DISK_QUOTA_EXCEEDED = 1295,
2281
22821553 /// The requested file operation failed because the storage policy blocks that type of file.
22831554 /// For more information, contact your system administrator.
22841555 CONTENT_BLOCKED = 1296,
2285
22861556 /// A privilege that the service requires to function properly does not exist in the service account configuration.
22871557 /// You may use the Services Microsoft Management Console (MMC) snap-in (services.msc) and the Local Security Settings MMC snap-in (secpol.msc) to view the service configuration and the account configuration.
22881558 INCOMPATIBLE_SERVICE_PRIVILEGE = 1297,
2289
22901559 /// A thread involved in this operation appears to be unresponsive.
22911560 APP_HANG = 1298,
2292
22931561 /// Indicates a particular Security ID may not be assigned as the label of an object.
22941562 INVALID_LABEL = 1299,
2295
22961563 /// Not all privileges or groups referenced are assigned to the caller.
22971564 NOT_ALL_ASSIGNED = 1300,
2298
22991565 /// Some mapping between account names and security IDs was not done.
23001566 SOME_NOT_MAPPED = 1301,
2301
23021567 /// No system quota limits are specifically set for this account.
23031568 NO_QUOTAS_FOR_ACCOUNT = 1302,
2304
23051569 /// No encryption key is available. A well-known encryption key was returned.
23061570 LOCAL_USER_SESSION_KEY = 1303,
2307
23081571 /// The password is too complex to be converted to a LAN Manager password.
23091572 /// The LAN Manager password returned is a NULL string.
23101573 NULL_LM_PASSWORD = 1304,
2311
23121574 /// The revision level is unknown.
23131575 UNKNOWN_REVISION = 1305,
2314
23151576 /// Indicates two revision levels are incompatible.
23161577 REVISION_MISMATCH = 1306,
2317
23181578 /// This security ID may not be assigned as the owner of this object.
23191579 INVALID_OWNER = 1307,
2320
23211580 /// This security ID may not be assigned as the primary group of an object.
23221581 INVALID_PRIMARY_GROUP = 1308,
2323
23241582 /// An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client.
23251583 NO_IMPERSONATION_TOKEN = 1309,
2326
23271584 /// The group may not be disabled.
23281585 CANT_DISABLE_MANDATORY = 1310,
2329
23301586 /// There are currently no logon servers available to service the logon request.
23311587 NO_LOGON_SERVERS = 1311,
2332
23331588 /// A specified logon session does not exist. It may already have been terminated.
23341589 NO_SUCH_LOGON_SESSION = 1312,
2335
23361590 /// A specified privilege does not exist.
23371591 NO_SUCH_PRIVILEGE = 1313,
2338
23391592 /// A required privilege is not held by the client.
23401593 PRIVILEGE_NOT_HELD = 1314,
2341
23421594 /// The name provided is not a properly formed account name.
23431595 INVALID_ACCOUNT_NAME = 1315,
2344
23451596 /// The specified account already exists.
23461597 USER_EXISTS = 1316,
2347
23481598 /// The specified account does not exist.
23491599 NO_SUCH_USER = 1317,
2350
23511600 /// The specified group already exists.
23521601 GROUP_EXISTS = 1318,
2353
23541602 /// The specified group does not exist.
23551603 NO_SUCH_GROUP = 1319,
2356
23571604 /// Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member.
23581605 MEMBER_IN_GROUP = 1320,
2359
23601606 /// The specified user account is not a member of the specified group account.
23611607 MEMBER_NOT_IN_GROUP = 1321,
2362
23631608 /// This operation is disallowed as it could result in an administration account being disabled, deleted or unable to log on.
23641609 LAST_ADMIN = 1322,
2365
23661610 /// Unable to update the password. The value provided as the current password is incorrect.
23671611 WRONG_PASSWORD = 1323,
2368
23691612 /// Unable to update the password. The value provided for the new password contains values that are not allowed in passwords.
23701613 ILL_FORMED_PASSWORD = 1324,
2371
23721614 /// Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirements of the domain.
23731615 PASSWORD_RESTRICTION = 1325,
2374
23751616 /// The user name or password is incorrect.
23761617 LOGON_FAILURE = 1326,
2377
23781618 /// Account restrictions are preventing this user from signing in.
23791619 /// For example: blank passwords aren't allowed, sign-in times are limited, or a policy restriction has been enforced.
23801620 ACCOUNT_RESTRICTION = 1327,
2381
23821621 /// Your account has time restrictions that keep you from signing in right now.
23831622 INVALID_LOGON_HOURS = 1328,
2384
23851623 /// This user isn't allowed to sign in to this computer.
23861624 INVALID_WORKSTATION = 1329,
2387
23881625 /// The password for this account has expired.
23891626 PASSWORD_EXPIRED = 1330,
2390
23911627 /// This user can't sign in because this account is currently disabled.
23921628 ACCOUNT_DISABLED = 1331,
2393
23941629 /// No mapping between account names and security IDs was done.
23951630 NONE_MAPPED = 1332,
2396
23971631 /// Too many local user identifiers (LUIDs) were requested at one time.
23981632 TOO_MANY_LUIDS_REQUESTED = 1333,
2399
24001633 /// No more local user identifiers (LUIDs) are available.
24011634 LUIDS_EXHAUSTED = 1334,
2402
24031635 /// The subauthority part of a security ID is invalid for this particular use.
24041636 INVALID_SUB_AUTHORITY = 1335,
2405
24061637 /// The access control list (ACL) structure is invalid.
24071638 INVALID_ACL = 1336,
2408
24091639 /// The security ID structure is invalid.
24101640 INVALID_SID = 1337,
2411
24121641 /// The security descriptor structure is invalid.
24131642 INVALID_SECURITY_DESCR = 1338,
2414
24151643 /// The inherited access control list (ACL) or access control entry (ACE) could not be built.
24161644 BAD_INHERITANCE_ACL = 1340,
2417
24181645 /// The server is currently disabled.
24191646 SERVER_DISABLED = 1341,
2420
24211647 /// The server is currently enabled.
24221648 SERVER_NOT_DISABLED = 1342,
2423
24241649 /// The value provided was an invalid value for an identifier authority.
24251650 INVALID_ID_AUTHORITY = 1343,
2426
24271651 /// No more memory is available for security information updates.
24281652 ALLOTTED_SPACE_EXCEEDED = 1344,
2429
24301653 /// The specified attributes are invalid, or incompatible with the attributes for the group as a whole.
24311654 INVALID_GROUP_ATTRIBUTES = 1345,
2432
24331655 /// Either a required impersonation level was not provided, or the provided impersonation level is invalid.
24341656 BAD_IMPERSONATION_LEVEL = 1346,
2435
24361657 /// Cannot open an anonymous level security token.
24371658 CANT_OPEN_ANONYMOUS = 1347,
2438
24391659 /// The validation information class requested was invalid.
24401660 BAD_VALIDATION_CLASS = 1348,
2441
24421661 /// The type of the token is inappropriate for its attempted use.
24431662 BAD_TOKEN_TYPE = 1349,
2444
24451663 /// Unable to perform a security operation on an object that has no associated security.
24461664 NO_SECURITY_ON_OBJECT = 1350,
2447
24481665 /// Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied.
24491666 CANT_ACCESS_DOMAIN_INFO = 1351,
2450
24511667 /// The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation.
24521668 INVALID_SERVER_STATE = 1352,
2453
24541669 /// The domain was in the wrong state to perform the security operation.
24551670 INVALID_DOMAIN_STATE = 1353,
2456
24571671 /// This operation is only allowed for the Primary Domain Controller of the domain.
24581672 INVALID_DOMAIN_ROLE = 1354,
2459
24601673 /// The specified domain either does not exist or could not be contacted.
24611674 NO_SUCH_DOMAIN = 1355,
2462
24631675 /// The specified domain already exists.
24641676 DOMAIN_EXISTS = 1356,
2465
24661677 /// An attempt was made to exceed the limit on the number of domains per server.
24671678 DOMAIN_LIMIT_EXCEEDED = 1357,
2468
24691679 /// Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.
24701680 INTERNAL_DB_CORRUPTION = 1358,
2471
24721681 /// An internal error occurred.
24731682 INTERNAL_ERROR = 1359,
2474
24751683 /// Generic access types were contained in an access mask which should already be mapped to nongeneric types.
24761684 GENERIC_NOT_MAPPED = 1360,
2477
24781685 /// A security descriptor is not in the right format (absolute or self-relative).
24791686 BAD_DESCRIPTOR_FORMAT = 1361,
2480
24811687 /// The requested action is restricted for use by logon processes only.
24821688 /// The calling process has not registered as a logon process.
24831689 NOT_LOGON_PROCESS = 1362,
2484
24851690 /// Cannot start a new logon session with an ID that is already in use.
24861691 LOGON_SESSION_EXISTS = 1363,
2487
24881692 /// A specified authentication package is unknown.
24891693 NO_SUCH_PACKAGE = 1364,
2490
24911694 /// The logon session is not in a state that is consistent with the requested operation.
24921695 BAD_LOGON_SESSION_STATE = 1365,
2493
24941696 /// The logon session ID is already in use.
24951697 LOGON_SESSION_COLLISION = 1366,
2496
24971698 /// A logon request contained an invalid logon type value.
24981699 INVALID_LOGON_TYPE = 1367,
2499
25001700 /// Unable to impersonate using a named pipe until data has been read from that pipe.
25011701 CANNOT_IMPERSONATE = 1368,
2502
25031702 /// The transaction state of a registry subtree is incompatible with the requested operation.
25041703 RXACT_INVALID_STATE = 1369,
2505
25061704 /// An internal security database corruption has been encountered.
25071705 RXACT_COMMIT_FAILURE = 1370,
2508
25091706 /// Cannot perform this operation on built-in accounts.
25101707 SPECIAL_ACCOUNT = 1371,
2511
25121708 /// Cannot perform this operation on this built-in special group.
25131709 SPECIAL_GROUP = 1372,
2514
25151710 /// Cannot perform this operation on this built-in special user.
25161711 SPECIAL_USER = 1373,
2517
25181712 /// The user cannot be removed from a group because the group is currently the user's primary group.
25191713 MEMBERS_PRIMARY_GROUP = 1374,
2520
25211714 /// The token is already in use as a primary token.
25221715 TOKEN_ALREADY_IN_USE = 1375,
2523
25241716 /// The specified local group does not exist.
25251717 NO_SUCH_ALIAS = 1376,
2526
25271718 /// The specified account name is not a member of the group.
25281719 MEMBER_NOT_IN_ALIAS = 1377,
2529
25301720 /// The specified account name is already a member of the group.
25311721 MEMBER_IN_ALIAS = 1378,
2532
25331722 /// The specified local group already exists.
25341723 ALIAS_EXISTS = 1379,
2535
25361724 /// Logon failure: the user has not been granted the requested logon type at this computer.
25371725 LOGON_NOT_GRANTED = 1380,
2538
25391726 /// The maximum number of secrets that may be stored in a single system has been exceeded.
25401727 TOO_MANY_SECRETS = 1381,
2541
25421728 /// The length of a secret exceeds the maximum length allowed.
25431729 SECRET_TOO_LONG = 1382,
2544
25451730 /// The local security authority database contains an internal inconsistency.
25461731 INTERNAL_DB_ERROR = 1383,
2547
25481732 /// During a logon attempt, the user's security context accumulated too many security IDs.
25491733 TOO_MANY_CONTEXT_IDS = 1384,
2550
25511734 /// Logon failure: the user has not been granted the requested logon type at this computer.
25521735 LOGON_TYPE_NOT_GRANTED = 1385,
2553
25541736 /// A cross-encrypted password is necessary to change a user password.
25551737 NT_CROSS_ENCRYPTION_REQUIRED = 1386,
2556
25571738 /// A member could not be added to or removed from the local group because the member does not exist.
25581739 NO_SUCH_MEMBER = 1387,
2559
25601740 /// A new member could not be added to a local group because the member has the wrong account type.
25611741 INVALID_MEMBER = 1388,
2562
25631742 /// Too many security IDs have been specified.
25641743 TOO_MANY_SIDS = 1389,
2565
25661744 /// A cross-encrypted password is necessary to change this user password.
25671745 LM_CROSS_ENCRYPTION_REQUIRED = 1390,
2568
25691746 /// Indicates an ACL contains no inheritable components.
25701747 NO_INHERITANCE = 1391,
2571
25721748 /// The file or directory is corrupted and unreadable.
25731749 FILE_CORRUPT = 1392,
2574
25751750 /// The disk structure is corrupted and unreadable.
25761751 DISK_CORRUPT = 1393,
2577
25781752 /// There is no user session key for the specified logon session.
25791753 NO_USER_SESSION_KEY = 1394,
2580
25811754 /// The service being accessed is licensed for a particular number of connections.
25821755 /// No more connections can be made to the service at this time because there are already as many connections as the service can accept.
25831756 LICENSE_QUOTA_EXCEEDED = 1395,
2584
25851757 /// The target account name is incorrect.
25861758 WRONG_TARGET_NAME = 1396,
2587
25881759 /// Mutual Authentication failed. The server's password is out of date at the domain controller.
25891760 MUTUAL_AUTH_FAILED = 1397,
2590
25911761 /// There is a time and/or date difference between the client and server.
25921762 TIME_SKEW = 1398,
2593
25941763 /// This operation cannot be performed on the current domain.
25951764 CURRENT_DOMAIN_NOT_ALLOWED = 1399,
2596
25971765 /// Invalid window handle.
25981766 INVALID_WINDOW_HANDLE = 1400,
2599
26001767 /// Invalid menu handle.
26011768 INVALID_MENU_HANDLE = 1401,
2602
26031769 /// Invalid cursor handle.
26041770 INVALID_CURSOR_HANDLE = 1402,
2605
26061771 /// Invalid accelerator table handle.
26071772 INVALID_ACCEL_HANDLE = 1403,
2608
26091773 /// Invalid hook handle.
26101774 INVALID_HOOK_HANDLE = 1404,
2611
26121775 /// Invalid handle to a multiple-window position structure.
26131776 INVALID_DWP_HANDLE = 1405,
2614
26151777 /// Cannot create a top-level child window.
26161778 TLW_WITH_WSCHILD = 1406,
2617
26181779 /// Cannot find window class.
26191780 CANNOT_FIND_WND_CLASS = 1407,
2620
26211781 /// Invalid window; it belongs to other thread.
26221782 WINDOW_OF_OTHER_THREAD = 1408,
2623
26241783 /// Hot key is already registered.
26251784 HOTKEY_ALREADY_REGISTERED = 1409,
2626
26271785 /// Class already exists.
26281786 CLASS_ALREADY_EXISTS = 1410,
2629
26301787 /// Class does not exist.
26311788 CLASS_DOES_NOT_EXIST = 1411,
2632
26331789 /// Class still has open windows.
26341790 CLASS_HAS_WINDOWS = 1412,
2635
26361791 /// Invalid index.
26371792 INVALID_INDEX = 1413,
2638
26391793 /// Invalid icon handle.
26401794 INVALID_ICON_HANDLE = 1414,
2641
26421795 /// Using private DIALOG window words.
26431796 PRIVATE_DIALOG_INDEX = 1415,
2644
26451797 /// The list box identifier was not found.
26461798 LISTBOX_ID_NOT_FOUND = 1416,
2647
26481799 /// No wildcards were found.
26491800 NO_WILDCARD_CHARACTERS = 1417,
2650
26511801 /// Thread does not have a clipboard open.
26521802 CLIPBOARD_NOT_OPEN = 1418,
2653
26541803 /// Hot key is not registered.
26551804 HOTKEY_NOT_REGISTERED = 1419,
2656
26571805 /// The window is not a valid dialog window.
26581806 WINDOW_NOT_DIALOG = 1420,
2659
26601807 /// Control ID not found.
26611808 CONTROL_ID_NOT_FOUND = 1421,
2662
26631809 /// Invalid message for a combo box because it does not have an edit control.
26641810 INVALID_COMBOBOX_MESSAGE = 1422,
2665
26661811 /// The window is not a combo box.
26671812 WINDOW_NOT_COMBOBOX = 1423,
2668
26691813 /// Height must be less than 256.
26701814 INVALID_EDIT_HEIGHT = 1424,
2671
26721815 /// Invalid device context (DC) handle.
26731816 DC_NOT_FOUND = 1425,
2674
26751817 /// Invalid hook procedure type.
26761818 INVALID_HOOK_FILTER = 1426,
2677
26781819 /// Invalid hook procedure.
26791820 INVALID_FILTER_PROC = 1427,
2680
26811821 /// Cannot set nonlocal hook without a module handle.
26821822 HOOK_NEEDS_HMOD = 1428,
2683
26841823 /// This hook procedure can only be set globally.
26851824 GLOBAL_ONLY_HOOK = 1429,
2686
26871825 /// The journal hook procedure is already installed.
26881826 JOURNAL_HOOK_SET = 1430,
2689
26901827 /// The hook procedure is not installed.
26911828 HOOK_NOT_INSTALLED = 1431,
2692
26931829 /// Invalid message for single-selection list box.
26941830 INVALID_LB_MESSAGE = 1432,
2695
26961831 /// LB_SETCOUNT sent to non-lazy list box.
26971832 SETCOUNT_ON_BAD_LB = 1433,
2698
26991833 /// This list box does not support tab stops.
27001834 LB_WITHOUT_TABSTOPS = 1434,
2701
27021835 /// Cannot destroy object created by another thread.
27031836 DESTROY_OBJECT_OF_OTHER_THREAD = 1435,
2704
27051837 /// Child windows cannot have menus.
27061838 CHILD_WINDOW_MENU = 1436,
2707
27081839 /// The window does not have a system menu.
27091840 NO_SYSTEM_MENU = 1437,
2710
27111841 /// Invalid message box style.
27121842 INVALID_MSGBOX_STYLE = 1438,
2713
27141843 /// Invalid system-wide (SPI_*) parameter.
27151844 INVALID_SPI_VALUE = 1439,
2716
27171845 /// Screen already locked.
27181846 SCREEN_ALREADY_LOCKED = 1440,
2719
27201847 /// All handles to windows in a multiple-window position structure must have the same parent.
27211848 HWNDS_HAVE_DIFF_PARENT = 1441,
2722
27231849 /// The window is not a child window.
27241850 NOT_CHILD_WINDOW = 1442,
2725
27261851 /// Invalid GW_* command.
27271852 INVALID_GW_COMMAND = 1443,
2728
27291853 /// Invalid thread identifier.
27301854 INVALID_THREAD_ID = 1444,
2731
27321855 /// Cannot process a message from a window that is not a multiple document interface (MDI) window.
27331856 NON_MDICHILD_WINDOW = 1445,
2734
27351857 /// Popup menu already active.
27361858 POPUP_ALREADY_ACTIVE = 1446,
2737
27381859 /// The window does not have scroll bars.
27391860 NO_SCROLLBARS = 1447,
2740
27411861 /// Scroll bar range cannot be greater than MAXLONG.
27421862 INVALID_SCROLLBAR_RANGE = 1448,
2743
27441863 /// Cannot show or remove the window in the way specified.
27451864 INVALID_SHOWWIN_COMMAND = 1449,
2746
27471865 /// Insufficient system resources exist to complete the requested service.
27481866 NO_SYSTEM_RESOURCES = 1450,
2749
27501867 /// Insufficient system resources exist to complete the requested service.
27511868 NONPAGED_SYSTEM_RESOURCES = 1451,
2752
27531869 /// Insufficient system resources exist to complete the requested service.
27541870 PAGED_SYSTEM_RESOURCES = 1452,
2755
27561871 /// Insufficient quota to complete the requested service.
27571872 WORKING_SET_QUOTA = 1453,
2758
27591873 /// Insufficient quota to complete the requested service.
27601874 PAGEFILE_QUOTA = 1454,
2761
27621875 /// The paging file is too small for this operation to complete.
27631876 COMMITMENT_LIMIT = 1455,
2764
27651877 /// A menu item was not found.
27661878 MENU_ITEM_NOT_FOUND = 1456,
2767
27681879 /// Invalid keyboard layout handle.
27691880 INVALID_KEYBOARD_HANDLE = 1457,
2770
27711881 /// Hook type not allowed.
27721882 HOOK_TYPE_NOT_ALLOWED = 1458,
2773
27741883 /// This operation requires an interactive window station.
27751884 REQUIRES_INTERACTIVE_WINDOWSTATION = 1459,
2776
27771885 /// This operation returned because the timeout period expired.
27781886 TIMEOUT = 1460,
2779
27801887 /// Invalid monitor handle.
27811888 INVALID_MONITOR_HANDLE = 1461,
2782
27831889 /// Incorrect size argument.
27841890 INCORRECT_SIZE = 1462,
2785
27861891 /// The symbolic link cannot be followed because its type is disabled.
27871892 SYMLINK_CLASS_DISABLED = 1463,
2788
27891893 /// This application does not support the current operation on symbolic links.
27901894 SYMLINK_NOT_SUPPORTED = 1464,
2791
27921895 /// Windows was unable to parse the requested XML data.
27931896 XML_PARSE_ERROR = 1465,
2794
27951897 /// An error was encountered while processing an XML digital signature.
27961898 XMLDSIG_ERROR = 1466,
2797
27981899 /// This application must be restarted.
27991900 RESTART_APPLICATION = 1467,
2800
28011901 /// The caller made the connection request in the wrong routing compartment.
28021902 WRONG_COMPARTMENT = 1468,
2803
28041903 /// There was an AuthIP failure when attempting to connect to the remote host.
28051904 AUTHIP_FAILURE = 1469,
2806
28071905 /// Insufficient NVRAM resources exist to complete the requested service. A reboot might be required.
28081906 NO_NVRAM_RESOURCES = 1470,
2809
28101907 /// Unable to finish the requested operation because the specified process is not a GUI process.
28111908 NOT_GUI_PROCESS = 1471,
2812
28131909 /// The event log file is corrupted.
28141910 EVENTLOG_FILE_CORRUPT = 1500,
2815
28161911 /// No event log file could be opened, so the event logging service did not start.
28171912 EVENTLOG_CANT_START = 1501,
2818
28191913 /// The event log file is full.
28201914 LOG_FILE_FULL = 1502,
2821
28221915 /// The event log file has changed between read operations.
28231916 EVENTLOG_FILE_CHANGED = 1503,
2824
28251917 /// The specified task name is invalid.
28261918 INVALID_TASK_NAME = 1550,
2827
28281919 /// The specified task index is invalid.
28291920 INVALID_TASK_INDEX = 1551,
2830
28311921 /// The specified thread is already joining a task.
28321922 THREAD_ALREADY_IN_TASK = 1552,
2833
28341923 /// The Windows Installer Service could not be accessed.
28351924 /// This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.
28361925 INSTALL_SERVICE_FAILURE = 1601,
2837
28381926 /// User cancelled installation.
28391927 INSTALL_USEREXIT = 1602,
2840
28411928 /// Fatal error during installation.
28421929 INSTALL_FAILURE = 1603,
2843
28441930 /// Installation suspended, incomplete.
28451931 INSTALL_SUSPEND = 1604,
2846
28471932 /// This action is only valid for products that are currently installed.
28481933 UNKNOWN_PRODUCT = 1605,
2849
28501934 /// Feature ID not registered.
28511935 UNKNOWN_FEATURE = 1606,
2852
28531936 /// Component ID not registered.
28541937 UNKNOWN_COMPONENT = 1607,
2855
28561938 /// Unknown property.
28571939 UNKNOWN_PROPERTY = 1608,
2858
28591940 /// Handle is in an invalid state.
28601941 INVALID_HANDLE_STATE = 1609,
2861
28621942 /// The configuration data for this product is corrupt. Contact your support personnel.
28631943 BAD_CONFIGURATION = 1610,
2864
28651944 /// Component qualifier not present.
28661945 INDEX_ABSENT = 1611,
2867
28681946 /// The installation source for this product is not available.
28691947 /// Verify that the source exists and that you can access it.
28701948 INSTALL_SOURCE_ABSENT = 1612,
2871
28721949 /// This installation package cannot be installed by the Windows Installer service.
28731950 /// You must install a Windows service pack that contains a newer version of the Windows Installer service.
28741951 INSTALL_PACKAGE_VERSION = 1613,
2875
28761952 /// Product is uninstalled.
28771953 PRODUCT_UNINSTALLED = 1614,
2878
28791954 /// SQL query syntax invalid or unsupported.
28801955 BAD_QUERY_SYNTAX = 1615,
2881
28821956 /// Record field does not exist.
28831957 INVALID_FIELD = 1616,
2884
28851958 /// The device has been removed.
28861959 DEVICE_REMOVED = 1617,
2887
28881960 /// Another installation is already in progress.
28891961 /// Complete that installation before proceeding with this install.
28901962 INSTALL_ALREADY_RUNNING = 1618,
2891
28921963 /// This installation package could not be opened.
28931964 /// Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
28941965 INSTALL_PACKAGE_OPEN_FAILED = 1619,
2895
28961966 /// This installation package could not be opened.
28971967 /// Contact the application vendor to verify that this is a valid Windows Installer package.
28981968 INSTALL_PACKAGE_INVALID = 1620,
2899
29001969 /// There was an error starting the Windows Installer service user interface. Contact your support personnel.
29011970 INSTALL_UI_FAILURE = 1621,
2902
29031971 /// Error opening installation log file.
29041972 /// Verify that the specified log file location exists and that you can write to it.
29051973 INSTALL_LOG_FAILURE = 1622,
2906
29071974 /// The language of this installation package is not supported by your system.
29081975 INSTALL_LANGUAGE_UNSUPPORTED = 1623,
2909
29101976 /// Error applying transforms. Verify that the specified transform paths are valid.
29111977 INSTALL_TRANSFORM_FAILURE = 1624,
2912
29131978 /// This installation is forbidden by system policy. Contact your system administrator.
29141979 INSTALL_PACKAGE_REJECTED = 1625,
2915
29161980 /// Function could not be executed.
29171981 FUNCTION_NOT_CALLED = 1626,
2918
29191982 /// Function failed during execution.
29201983 FUNCTION_FAILED = 1627,
2921
29221984 /// Invalid or unknown table specified.
29231985 INVALID_TABLE = 1628,
2924
29251986 /// Data supplied is of wrong type.
29261987 DATATYPE_MISMATCH = 1629,
2927
29281988 /// Data of this type is not supported.
29291989 UNSUPPORTED_TYPE = 1630,
2930
29311990 /// The Windows Installer service failed to start. Contact your support personnel.
29321991 CREATE_FAILED = 1631,
2933
29341992 /// The Temp folder is on a drive that is full or is inaccessible.
29351993 /// Free up space on the drive or verify that you have write permission on the Temp folder.
29361994 INSTALL_TEMP_UNWRITABLE = 1632,
2937
29381995 /// This installation package is not supported by this processor type. Contact your product vendor.
29391996 INSTALL_PLATFORM_UNSUPPORTED = 1633,
2940
29411997 /// Component not used on this computer.
29421998 INSTALL_NOTUSED = 1634,
2943
29441999 /// This update package could not be opened.
29452000 /// Verify that the update package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer update package.
29462001 PATCH_PACKAGE_OPEN_FAILED = 1635,
2947
29482002 /// This update package could not be opened.
29492003 /// Contact the application vendor to verify that this is a valid Windows Installer update package.
29502004 PATCH_PACKAGE_INVALID = 1636,
2951
29522005 /// This update package cannot be processed by the Windows Installer service.
29532006 /// You must install a Windows service pack that contains a newer version of the Windows Installer service.
29542007 PATCH_PACKAGE_UNSUPPORTED = 1637,
2955
29562008 /// Another version of this product is already installed. Installation of this version cannot continue.
29572009 /// To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
29582010 PRODUCT_VERSION = 1638,
2959
29602011 /// Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.
29612012 INVALID_COMMAND_LINE = 1639,
2962
29632013 /// Only administrators have permission to add, remove, or configure server software during a Terminal services remote session.
29642014 /// If you want to install or configure software on the server, contact your network administrator.
29652015 INSTALL_REMOTE_DISALLOWED = 1640,
2966
29672016 /// The requested operation completed successfully.
29682017 /// The system will be restarted so the changes can take effect.
29692018 SUCCESS_REBOOT_INITIATED = 1641,
2970
29712019 /// The upgrade cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade may update a different version of the program.
29722020 /// Verify that the program to be upgraded exists on your computer and that you have the correct upgrade.
29732021 PATCH_TARGET_NOT_FOUND = 1642,
2974
29752022 /// The update package is not permitted by software restriction policy.
29762023 PATCH_PACKAGE_REJECTED = 1643,
2977
29782024 /// One or more customizations are not permitted by software restriction policy.
29792025 INSTALL_TRANSFORM_REJECTED = 1644,
2980
29812026 /// The Windows Installer does not permit installation from a Remote Desktop Connection.
29822027 INSTALL_REMOTE_PROHIBITED = 1645,
2983
29842028 /// Uninstallation of the update package is not supported.
29852029 PATCH_REMOVAL_UNSUPPORTED = 1646,
2986
29872030 /// The update is not applied to this product.
29882031 UNKNOWN_PATCH = 1647,
2989
29902032 /// No valid sequence could be found for the set of updates.
29912033 PATCH_NO_SEQUENCE = 1648,
2992
29932034 /// Update removal was disallowed by policy.
29942035 PATCH_REMOVAL_DISALLOWED = 1649,
2995
29962036 /// The XML update data is invalid.
29972037 INVALID_PATCH_XML = 1650,
2998
29992038 /// Windows Installer does not permit updating of managed advertised products.
30002039 /// At least one feature of the product must be installed before applying the update.
30012040 PATCH_MANAGED_ADVERTISED_PRODUCT = 1651,
3002
30032041 /// The Windows Installer service is not accessible in Safe Mode.
30042042 /// Please try again when your computer is not in Safe Mode or you can use System Restore to return your machine to a previous good state.
30052043 INSTALL_SERVICE_SAFEBOOT = 1652,
3006
30072044 /// A fail fast exception occurred.
30082045 /// Exception handlers will not be invoked and the process will be terminated immediately.
30092046 FAIL_FAST_EXCEPTION = 1653,
3010
30112047 /// The app that you are trying to run is not supported on this version of Windows.
30122048 INSTALL_REJECTED = 1654,
3013
30142049 /// The string binding is invalid.
30152050 RPC_S_INVALID_STRING_BINDING = 1700,
3016
30172051 /// The binding handle is not the correct type.
30182052 RPC_S_WRONG_KIND_OF_BINDING = 1701,
3019
30202053 /// The binding handle is invalid.
30212054 RPC_S_INVALID_BINDING = 1702,
3022
30232055 /// The RPC protocol sequence is not supported.
30242056 RPC_S_PROTSEQ_NOT_SUPPORTED = 1703,
3025
30262057 /// The RPC protocol sequence is invalid.
30272058 RPC_S_INVALID_RPC_PROTSEQ = 1704,
3028
30292059 /// The string universal unique identifier (UUID) is invalid.
30302060 RPC_S_INVALID_STRING_UUID = 1705,
3031
30322061 /// The endpoint format is invalid.
30332062 RPC_S_INVALID_ENDPOINT_FORMAT = 1706,
3034
30352063 /// The network address is invalid.
30362064 RPC_S_INVALID_NET_ADDR = 1707,
3037
30382065 /// No endpoint was found.
30392066 RPC_S_NO_ENDPOINT_FOUND = 1708,
3040
30412067 /// The timeout value is invalid.
30422068 RPC_S_INVALID_TIMEOUT = 1709,
3043
30442069 /// The object universal unique identifier (UUID) was not found.
30452070 RPC_S_OBJECT_NOT_FOUND = 1710,
3046
30472071 /// The object universal unique identifier (UUID) has already been registered.
30482072 RPC_S_ALREADY_REGISTERED = 1711,
3049
30502073 /// The type universal unique identifier (UUID) has already been registered.
30512074 RPC_S_TYPE_ALREADY_REGISTERED = 1712,
3052
30532075 /// The RPC server is already listening.
30542076 RPC_S_ALREADY_LISTENING = 1713,
3055
30562077 /// No protocol sequences have been registered.
30572078 RPC_S_NO_PROTSEQS_REGISTERED = 1714,
3058
30592079 /// The RPC server is not listening.
30602080 RPC_S_NOT_LISTENING = 1715,
3061
30622081 /// The manager type is unknown.
30632082 RPC_S_UNKNOWN_MGR_TYPE = 1716,
3064
30652083 /// The interface is unknown.
30662084 RPC_S_UNKNOWN_IF = 1717,
3067
30682085 /// There are no bindings.
30692086 RPC_S_NO_BINDINGS = 1718,
3070
30712087 /// There are no protocol sequences.
30722088 RPC_S_NO_PROTSEQS = 1719,
3073
30742089 /// The endpoint cannot be created.
30752090 RPC_S_CANT_CREATE_ENDPOINT = 1720,
3076
30772091 /// Not enough resources are available to complete this operation.
30782092 RPC_S_OUT_OF_RESOURCES = 1721,
3079
30802093 /// The RPC server is unavailable.
30812094 RPC_S_SERVER_UNAVAILABLE = 1722,
3082
30832095 /// The RPC server is too busy to complete this operation.
30842096 RPC_S_SERVER_TOO_BUSY = 1723,
3085
30862097 /// The network options are invalid.
30872098 RPC_S_INVALID_NETWORK_OPTIONS = 1724,
3088
30892099 /// There are no remote procedure calls active on this thread.
30902100 RPC_S_NO_CALL_ACTIVE = 1725,
3091
30922101 /// The remote procedure call failed.
30932102 RPC_S_CALL_FAILED = 1726,
3094
30952103 /// The remote procedure call failed and did not execute.
30962104 RPC_S_CALL_FAILED_DNE = 1727,
3097
30982105 /// A remote procedure call (RPC) protocol error occurred.
30992106 RPC_S_PROTOCOL_ERROR = 1728,
3100
31012107 /// Access to the HTTP proxy is denied.
31022108 RPC_S_PROXY_ACCESS_DENIED = 1729,
3103
31042109 /// The transfer syntax is not supported by the RPC server.
31052110 RPC_S_UNSUPPORTED_TRANS_SYN = 1730,
3106
31072111 /// The universal unique identifier (UUID) type is not supported.
31082112 RPC_S_UNSUPPORTED_TYPE = 1732,
3109
31102113 /// The tag is invalid.
31112114 RPC_S_INVALID_TAG = 1733,
3112
31132115 /// The array bounds are invalid.
31142116 RPC_S_INVALID_BOUND = 1734,
3115
31162117 /// The binding does not contain an entry name.
31172118 RPC_S_NO_ENTRY_NAME = 1735,
3118
31192119 /// The name syntax is invalid.
31202120 RPC_S_INVALID_NAME_SYNTAX = 1736,
3121
31222121 /// The name syntax is not supported.
31232122 RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737,
3124
31252123 /// No network address is available to use to construct a universal unique identifier (UUID).
31262124 RPC_S_UUID_NO_ADDRESS = 1739,
3127
31282125 /// The endpoint is a duplicate.
31292126 RPC_S_DUPLICATE_ENDPOINT = 1740,
3130
31312127 /// The authentication type is unknown.
31322128 RPC_S_UNKNOWN_AUTHN_TYPE = 1741,
3133
31342129 /// The maximum number of calls is too small.
31352130 RPC_S_MAX_CALLS_TOO_SMALL = 1742,
3136
31372131 /// The string is too long.
31382132 RPC_S_STRING_TOO_LONG = 1743,
3139
31402133 /// The RPC protocol sequence was not found.
31412134 RPC_S_PROTSEQ_NOT_FOUND = 1744,
3142
31432135 /// The procedure number is out of range.
31442136 RPC_S_PROCNUM_OUT_OF_RANGE = 1745,
3145
31462137 /// The binding does not contain any authentication information.
31472138 RPC_S_BINDING_HAS_NO_AUTH = 1746,
3148
31492139 /// The authentication service is unknown.
31502140 RPC_S_UNKNOWN_AUTHN_SERVICE = 1747,
3151
31522141 /// The authentication level is unknown.
31532142 RPC_S_UNKNOWN_AUTHN_LEVEL = 1748,
3154
31552143 /// The security context is invalid.
31562144 RPC_S_INVALID_AUTH_IDENTITY = 1749,
3157
31582145 /// The authorization service is unknown.
31592146 RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750,
3160
31612147 /// The entry is invalid.
31622148 EPT_S_INVALID_ENTRY = 1751,
3163
31642149 /// The server endpoint cannot perform the operation.
31652150 EPT_S_CANT_PERFORM_OP = 1752,
3166
31672151 /// There are no more endpoints available from the endpoint mapper.
31682152 EPT_S_NOT_REGISTERED = 1753,
3169
31702153 /// No interfaces have been exported.
31712154 RPC_S_NOTHING_TO_EXPORT = 1754,
3172
31732155 /// The entry name is incomplete.
31742156 RPC_S_INCOMPLETE_NAME = 1755,
3175
31762157 /// The version option is invalid.
31772158 RPC_S_INVALID_VERS_OPTION = 1756,
3178
31792159 /// There are no more members.
31802160 RPC_S_NO_MORE_MEMBERS = 1757,
3181
31822161 /// There is nothing to unexport.
31832162 RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758,
3184
31852163 /// The interface was not found.
31862164 RPC_S_INTERFACE_NOT_FOUND = 1759,
3187
31882165 /// The entry already exists.
31892166 RPC_S_ENTRY_ALREADY_EXISTS = 1760,
3190
31912167 /// The entry is not found.
31922168 RPC_S_ENTRY_NOT_FOUND = 1761,
3193
31942169 /// The name service is unavailable.
31952170 RPC_S_NAME_SERVICE_UNAVAILABLE = 1762,
3196
31972171 /// The network address family is invalid.
31982172 RPC_S_INVALID_NAF_ID = 1763,
3199
32002173 /// The requested operation is not supported.
32012174 RPC_S_CANNOT_SUPPORT = 1764,
3202
32032175 /// No security context is available to allow impersonation.
32042176 RPC_S_NO_CONTEXT_AVAILABLE = 1765,
3205
32062177 /// An internal error occurred in a remote procedure call (RPC).
32072178 RPC_S_INTERNAL_ERROR = 1766,
3208
32092179 /// The RPC server attempted an integer division by zero.
32102180 RPC_S_ZERO_DIVIDE = 1767,
3211
32122181 /// An addressing error occurred in the RPC server.
32132182 RPC_S_ADDRESS_ERROR = 1768,
3214
32152183 /// A floating-point operation at the RPC server caused a division by zero.
32162184 RPC_S_FP_DIV_ZERO = 1769,
3217
32182185 /// A floating-point underflow occurred at the RPC server.
32192186 RPC_S_FP_UNDERFLOW = 1770,
3220
32212187 /// A floating-point overflow occurred at the RPC server.
32222188 RPC_S_FP_OVERFLOW = 1771,
3223
32242189 /// The list of RPC servers available for the binding of auto handles has been exhausted.
32252190 RPC_X_NO_MORE_ENTRIES = 1772,
3226
32272191 /// Unable to open the character translation table file.
32282192 RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773,
3229
32302193 /// The file containing the character translation table has fewer than 512 bytes.
32312194 RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774,
3232
32332195 /// A null context handle was passed from the client to the host during a remote procedure call.
32342196 RPC_X_SS_IN_NULL_CONTEXT = 1775,
3235
32362197 /// The context handle changed during a remote procedure call.
32372198 RPC_X_SS_CONTEXT_DAMAGED = 1777,
3238
32392199 /// The binding handles passed to a remote procedure call do not match.
32402200 RPC_X_SS_HANDLES_MISMATCH = 1778,
3241
32422201 /// The stub is unable to get the remote procedure call handle.
32432202 RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779,
3244
32452203 /// A null reference pointer was passed to the stub.
32462204 RPC_X_NULL_REF_POINTER = 1780,
3247
32482205 /// The enumeration value is out of range.
32492206 RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781,
3250
32512207 /// The byte count is too small.
32522208 RPC_X_BYTE_COUNT_TOO_SMALL = 1782,
3253
32542209 /// The stub received bad data.
32552210 RPC_X_BAD_STUB_DATA = 1783,
3256
32572211 /// The supplied user buffer is not valid for the requested operation.
32582212 INVALID_USER_BUFFER = 1784,
3259
32602213 /// The disk media is not recognized. It may not be formatted.
32612214 UNRECOGNIZED_MEDIA = 1785,
3262
32632215 /// The workstation does not have a trust secret.
32642216 NO_TRUST_LSA_SECRET = 1786,
3265
32662217 /// The security database on the server does not have a computer account for this workstation trust relationship.
32672218 NO_TRUST_SAM_ACCOUNT = 1787,
3268
32692219 /// The trust relationship between the primary domain and the trusted domain failed.
32702220 TRUSTED_DOMAIN_FAILURE = 1788,
3271
32722221 /// The trust relationship between this workstation and the primary domain failed.
32732222 TRUSTED_RELATIONSHIP_FAILURE = 1789,
3274
32752223 /// The network logon failed.
32762224 TRUST_FAILURE = 1790,
3277
32782225 /// A remote procedure call is already in progress for this thread.
32792226 RPC_S_CALL_IN_PROGRESS = 1791,
3280
32812227 /// An attempt was made to logon, but the network logon service was not started.
32822228 NETLOGON_NOT_STARTED = 1792,
3283
32842229 /// The user's account has expired.
32852230 ACCOUNT_EXPIRED = 1793,
3286
32872231 /// The redirector is in use and cannot be unloaded.
32882232 REDIRECTOR_HAS_OPEN_HANDLES = 1794,
3289
32902233 /// The specified printer driver is already installed.
32912234 PRINTER_DRIVER_ALREADY_INSTALLED = 1795,
3292
32932235 /// The specified port is unknown.
32942236 UNKNOWN_PORT = 1796,
3295
32962237 /// The printer driver is unknown.
32972238 UNKNOWN_PRINTER_DRIVER = 1797,
3298
32992239 /// The print processor is unknown.
33002240 UNKNOWN_PRINTPROCESSOR = 1798,
3301
33022241 /// The specified separator file is invalid.
33032242 INVALID_SEPARATOR_FILE = 1799,
3304
33052243 /// The specified priority is invalid.
33062244 INVALID_PRIORITY = 1800,
3307
33082245 /// The printer name is invalid.
33092246 INVALID_PRINTER_NAME = 1801,
3310
33112247 /// The printer already exists.
33122248 PRINTER_ALREADY_EXISTS = 1802,
3313
33142249 /// The printer command is invalid.
33152250 INVALID_PRINTER_COMMAND = 1803,
3316
33172251 /// The specified datatype is invalid.
33182252 INVALID_DATATYPE = 1804,
3319
33202253 /// The environment specified is invalid.
33212254 INVALID_ENVIRONMENT = 1805,
3322
33232255 /// There are no more bindings.
33242256 RPC_S_NO_MORE_BINDINGS = 1806,
3325
33262257 /// The account used is an interdomain trust account.
33272258 /// Use your global user account or local user account to access this server.
33282259 NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807,
3329
33302260 /// The account used is a computer account.
33312261 /// Use your global user account or local user account to access this server.
33322262 NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808,
3333
33342263 /// The account used is a server trust account.
33352264 /// Use your global user account or local user account to access this server.
33362265 NOLOGON_SERVER_TRUST_ACCOUNT = 1809,
3337
33382266 /// The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain.
33392267 DOMAIN_TRUST_INCONSISTENT = 1810,
3340
33412268 /// The server is in use and cannot be unloaded.
33422269 SERVER_HAS_OPEN_HANDLES = 1811,
3343
33442270 /// The specified image file did not contain a resource section.
33452271 RESOURCE_DATA_NOT_FOUND = 1812,
3346
33472272 /// The specified resource type cannot be found in the image file.
33482273 RESOURCE_TYPE_NOT_FOUND = 1813,
3349
33502274 /// The specified resource name cannot be found in the image file.
33512275 RESOURCE_NAME_NOT_FOUND = 1814,
3352
33532276 /// The specified resource language ID cannot be found in the image file.
33542277 RESOURCE_LANG_NOT_FOUND = 1815,
3355
33562278 /// Not enough quota is available to process this command.
33572279 NOT_ENOUGH_QUOTA = 1816,
3358
33592280 /// No interfaces have been registered.
33602281 RPC_S_NO_INTERFACES = 1817,
3361
33622282 /// The remote procedure call was cancelled.
33632283 RPC_S_CALL_CANCELLED = 1818,
3364
33652284 /// The binding handle does not contain all required information.
33662285 RPC_S_BINDING_INCOMPLETE = 1819,
3367
33682286 /// A communications failure occurred during a remote procedure call.
33692287 RPC_S_COMM_FAILURE = 1820,
3370
33712288 /// The requested authentication level is not supported.
33722289 RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821,
3373
33742290 /// No principal name registered.
33752291 RPC_S_NO_PRINC_NAME = 1822,
3376
33772292 /// The error specified is not a valid Windows RPC error code.
33782293 RPC_S_NOT_RPC_ERROR = 1823,
3379
33802294 /// A UUID that is valid only on this computer has been allocated.
33812295 RPC_S_UUID_LOCAL_ONLY = 1824,
3382
33832296 /// A security package specific error occurred.
33842297 RPC_S_SEC_PKG_ERROR = 1825,
3385
33862298 /// Thread is not canceled.
33872299 RPC_S_NOT_CANCELLED = 1826,
3388
33892300 /// Invalid operation on the encoding/decoding handle.
33902301 RPC_X_INVALID_ES_ACTION = 1827,
3391
33922302 /// Incompatible version of the serializing package.
33932303 RPC_X_WRONG_ES_VERSION = 1828,
3394
33952304 /// Incompatible version of the RPC stub.
33962305 RPC_X_WRONG_STUB_VERSION = 1829,
3397
33982306 /// The RPC pipe object is invalid or corrupted.
33992307 RPC_X_INVALID_PIPE_OBJECT = 1830,
3400
34012308 /// An invalid operation was attempted on an RPC pipe object.
34022309 RPC_X_WRONG_PIPE_ORDER = 1831,
3403
34042310 /// Unsupported RPC pipe version.
34052311 RPC_X_WRONG_PIPE_VERSION = 1832,
3406
34072312 /// HTTP proxy server rejected the connection because the cookie authentication failed.
34082313 RPC_S_COOKIE_AUTH_FAILED = 1833,
3409
34102314 /// The group member was not found.
34112315 RPC_S_GROUP_MEMBER_NOT_FOUND = 1898,
3412
34132316 /// The endpoint mapper database entry could not be created.
34142317 EPT_S_CANT_CREATE = 1899,
3415
34162318 /// The object universal unique identifier (UUID) is the nil UUID.
34172319 RPC_S_INVALID_OBJECT = 1900,
3418
34192320 /// The specified time is invalid.
34202321 INVALID_TIME = 1901,
3421
34222322 /// The specified form name is invalid.
34232323 INVALID_FORM_NAME = 1902,
3424
34252324 /// The specified form size is invalid.
34262325 INVALID_FORM_SIZE = 1903,
3427
34282326 /// The specified printer handle is already being waited on.
34292327 ALREADY_WAITING = 1904,
3430
34312328 /// The specified printer has been deleted.
34322329 PRINTER_DELETED = 1905,
3433
34342330 /// The state of the printer is invalid.
34352331 INVALID_PRINTER_STATE = 1906,
3436
34372332 /// The user's password must be changed before signing in.
34382333 PASSWORD_MUST_CHANGE = 1907,
3439
34402334 /// Could not find the domain controller for this domain.
34412335 DOMAIN_CONTROLLER_NOT_FOUND = 1908,
3442
34432336 /// The referenced account is currently locked out and may not be logged on to.
34442337 ACCOUNT_LOCKED_OUT = 1909,
3445
34462338 /// The object exporter specified was not found.
34472339 OR_INVALID_OXID = 1910,
3448
34492340 /// The object specified was not found.
34502341 OR_INVALID_OID = 1911,
3451
34522342 /// The object resolver set specified was not found.
34532343 OR_INVALID_SET = 1912,
3454
34552344 /// Some data remains to be sent in the request buffer.
34562345 RPC_S_SEND_INCOMPLETE = 1913,
3457
34582346 /// Invalid asynchronous remote procedure call handle.
34592347 RPC_S_INVALID_ASYNC_HANDLE = 1914,
3460
34612348 /// Invalid asynchronous RPC call handle for this operation.
34622349 RPC_S_INVALID_ASYNC_CALL = 1915,
3463
34642350 /// The RPC pipe object has already been closed.
34652351 RPC_X_PIPE_CLOSED = 1916,
3466
34672352 /// The RPC call completed before all pipes were processed.
34682353 RPC_X_PIPE_DISCIPLINE_ERROR = 1917,
3469
34702354 /// No more data is available from the RPC pipe.
34712355 RPC_X_PIPE_EMPTY = 1918,
3472
34732356 /// No site name is available for this machine.
34742357 NO_SITENAME = 1919,
3475
34762358 /// The file cannot be accessed by the system.
34772359 CANT_ACCESS_FILE = 1920,
3478
34792360 /// The name of the file cannot be resolved by the system.
34802361 CANT_RESOLVE_FILENAME = 1921,
3481
34822362 /// The entry is not of the expected type.
34832363 RPC_S_ENTRY_TYPE_MISMATCH = 1922,
3484
34852364 /// Not all object UUIDs could be exported to the specified entry.
34862365 RPC_S_NOT_ALL_OBJS_EXPORTED = 1923,
3487
34882366 /// Interface could not be exported to the specified entry.
34892367 RPC_S_INTERFACE_NOT_EXPORTED = 1924,
3490
34912368 /// The specified profile entry could not be added.
34922369 RPC_S_PROFILE_NOT_ADDED = 1925,
3493
34942370 /// The specified profile element could not be added.
34952371 RPC_S_PRF_ELT_NOT_ADDED = 1926,
3496
34972372 /// The specified profile element could not be removed.
34982373 RPC_S_PRF_ELT_NOT_REMOVED = 1927,
3499
35002374 /// The group element could not be added.
35012375 RPC_S_GRP_ELT_NOT_ADDED = 1928,
3502
35032376 /// The group element could not be removed.
35042377 RPC_S_GRP_ELT_NOT_REMOVED = 1929,
3505
35062378 /// The printer driver is not compatible with a policy enabled on your computer that blocks NT 4.0 drivers.
35072379 KM_DRIVER_BLOCKED = 1930,
3508
35092380 /// The context has expired and can no longer be used.
35102381 CONTEXT_EXPIRED = 1931,
3511
35122382 /// The current user's delegated trust creation quota has been exceeded.
35132383 PER_USER_TRUST_QUOTA_EXCEEDED = 1932,
3514
35152384 /// The total delegated trust creation quota has been exceeded.
35162385 ALL_USER_TRUST_QUOTA_EXCEEDED = 1933,
3517
35182386 /// The current user's delegated trust deletion quota has been exceeded.
35192387 USER_DELETE_TRUST_QUOTA_EXCEEDED = 1934,
3520
35212388 /// The computer you are signing into is protected by an authentication firewall.
35222389 /// The specified account is not allowed to authenticate to the computer.
35232390 AUTHENTICATION_FIREWALL_FAILED = 1935,
3524
35252391 /// Remote connections to the Print Spooler are blocked by a policy set on your machine.
35262392 REMOTE_PRINT_CONNECTIONS_BLOCKED = 1936,
3527
35282393 /// Authentication failed because NTLM authentication has been disabled.
35292394 NTLM_BLOCKED = 1937,
3530
35312395 /// Logon Failure: EAS policy requires that the user change their password before this operation can be performed.
35322396 PASSWORD_CHANGE_REQUIRED = 1938,
3533
35342397 /// The pixel format is invalid.
35352398 INVALID_PIXEL_FORMAT = 2000,
3536
35372399 /// The specified driver is invalid.
35382400 BAD_DRIVER = 2001,
3539
35402401 /// The window style or class attribute is invalid for this operation.
35412402 INVALID_WINDOW_STYLE = 2002,
3542
35432403 /// The requested metafile operation is not supported.
35442404 METAFILE_NOT_SUPPORTED = 2003,
3545
35462405 /// The requested transformation operation is not supported.
35472406 TRANSFORM_NOT_SUPPORTED = 2004,
3548
35492407 /// The requested clipping operation is not supported.
35502408 CLIPPING_NOT_SUPPORTED = 2005,
3551
35522409 /// The specified color management module is invalid.
35532410 INVALID_CMM = 2010,
3554
35552411 /// The specified color profile is invalid.
35562412 INVALID_PROFILE = 2011,
3557
35582413 /// The specified tag was not found.
35592414 TAG_NOT_FOUND = 2012,
3560
35612415 /// A required tag is not present.
35622416 TAG_NOT_PRESENT = 2013,
3563
35642417 /// The specified tag is already present.
35652418 DUPLICATE_TAG = 2014,
3566
35672419 /// The specified color profile is not associated with the specified device.
35682420 PROFILE_NOT_ASSOCIATED_WITH_DEVICE = 2015,
3569
35702421 /// The specified color profile was not found.
35712422 PROFILE_NOT_FOUND = 2016,
3572
35732423 /// The specified color space is invalid.
35742424 INVALID_COLORSPACE = 2017,
3575
35762425 /// Image Color Management is not enabled.
35772426 ICM_NOT_ENABLED = 2018,
3578
35792427 /// There was an error while deleting the color transform.
35802428 DELETING_ICM_XFORM = 2019,
3581
35822429 /// The specified color transform is invalid.
35832430 INVALID_TRANSFORM = 2020,
3584
35852431 /// The specified transform does not match the bitmap's color space.
35862432 COLORSPACE_MISMATCH = 2021,
3587
35882433 /// The specified named color index is not present in the profile.
35892434 INVALID_COLORINDEX = 2022,
3590
35912435 /// The specified profile is intended for a device of a different type than the specified device.
35922436 PROFILE_DOES_NOT_MATCH_DEVICE = 2023,
3593
35942437 /// The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified.
35952438 CONNECTED_OTHER_PASSWORD = 2108,
3596
35972439 /// The network connection was made successfully using default credentials.
35982440 CONNECTED_OTHER_PASSWORD_DEFAULT = 2109,
3599
36002441 /// The specified username is invalid.
36012442 BAD_USERNAME = 2202,
3602
36032443 /// This network connection does not exist.
36042444 NOT_CONNECTED = 2250,
3605
36062445 /// This network connection has files open or requests pending.
36072446 OPEN_FILES = 2401,
3608
36092447 /// Active connections still exist.
36102448 ACTIVE_CONNECTIONS = 2402,
3611
36122449 /// The device is in use by an active process and cannot be disconnected.
36132450 DEVICE_IN_USE = 2404,
3614
36152451 /// The specified print monitor is unknown.
36162452 UNKNOWN_PRINT_MONITOR = 3000,
3617
36182453 /// The specified printer driver is currently in use.
36192454 PRINTER_DRIVER_IN_USE = 3001,
3620
36212455 /// The spool file was not found.
36222456 SPOOL_FILE_NOT_FOUND = 3002,
3623
36242457 /// A StartDocPrinter call was not issued.
36252458 SPL_NO_STARTDOC = 3003,
3626
36272459 /// An AddJob call was not issued.
36282460 SPL_NO_ADDJOB = 3004,
3629
36302461 /// The specified print processor has already been installed.
36312462 PRINT_PROCESSOR_ALREADY_INSTALLED = 3005,
3632
36332463 /// The specified print monitor has already been installed.
36342464 PRINT_MONITOR_ALREADY_INSTALLED = 3006,
3635
36362465 /// The specified print monitor does not have the required functions.
36372466 INVALID_PRINT_MONITOR = 3007,
3638
36392467 /// The specified print monitor is currently in use.
36402468 PRINT_MONITOR_IN_USE = 3008,
3641
36422469 /// The requested operation is not allowed when there are jobs queued to the printer.
36432470 PRINTER_HAS_JOBS_QUEUED = 3009,
3644
36452471 /// The requested operation is successful.
36462472 /// Changes will not be effective until the system is rebooted.
36472473 SUCCESS_REBOOT_REQUIRED = 3010,
3648
36492474 /// The requested operation is successful.
36502475 /// Changes will not be effective until the service is restarted.
36512476 SUCCESS_RESTART_REQUIRED = 3011,
3652
36532477 /// No printers were found.
36542478 PRINTER_NOT_FOUND = 3012,
3655
36562479 /// The printer driver is known to be unreliable.
36572480 PRINTER_DRIVER_WARNED = 3013,
3658
36592481 /// The printer driver is known to harm the system.
36602482 PRINTER_DRIVER_BLOCKED = 3014,
3661
36622483 /// The specified printer driver package is currently in use.
36632484 PRINTER_DRIVER_PACKAGE_IN_USE = 3015,
3664
36652485 /// Unable to find a core driver package that is required by the printer driver package.
36662486 CORE_DRIVER_PACKAGE_NOT_FOUND = 3016,
3667
36682487 /// The requested operation failed.
36692488 /// A system reboot is required to roll back changes made.
36702489 FAIL_REBOOT_REQUIRED = 3017,
3671
36722490 /// The requested operation failed.
36732491 /// A system reboot has been initiated to roll back changes made.
36742492 FAIL_REBOOT_INITIATED = 3018,
3675
36762493 /// The specified printer driver was not found on the system and needs to be downloaded.
36772494 PRINTER_DRIVER_DOWNLOAD_NEEDED = 3019,
3678
36792495 /// The requested print job has failed to print.
36802496 /// A print system update requires the job to be resubmitted.
36812497 PRINT_JOB_RESTART_REQUIRED = 3020,
3682
36832498 /// The printer driver does not contain a valid manifest, or contains too many manifests.
36842499 INVALID_PRINTER_DRIVER_MANIFEST = 3021,
3685
36862500 /// The specified printer cannot be shared.
36872501 PRINTER_NOT_SHAREABLE = 3022,
3688
36892502 /// The operation was paused.
36902503 REQUEST_PAUSED = 3050,
3691
36922504 /// Reissue the given operation as a cached IO operation.
36932505 IO_REISSUE_AS_CACHED = 3950,
3694
36952506 _,
36962507};
lib/std/os/windows/winmm.zig+6-1
......@@ -1,4 +1,9 @@
1usingnamespace @import("bits.zig");
1const std = @import("../../std.zig");
2const windows = std.os.windows;
3const WINAPI = windows.WINAPI;
4const UINT = windows.UINT;
5const BYTE = windows.BYTE;
6const DWORD = windows.DWORD;
27
38pub const MMRESULT = UINT;
49pub const MMSYSERR_BASE = 0;
lib/std/os/windows/ws2_32.zig+9
......@@ -1,4 +1,13 @@
11const std = @import("../../std.zig");
2const windows = std.os.windows;
3
4const WINAPI = windows.WINAPI;
5const OVERLAPPED = windows.OVERLAPPED;
6const WORD = windows.WORD;
7const DWORD = windows.DWORD;
8const GUID = windows.GUID;
9const USHORT = windows.USHORT;
10const WCHAR = windows.WCHAR;
211
312pub const SOCKET = *opaque {};
413pub const INVALID_SOCKET = @intToPtr(SOCKET, ~@as(usize, 0));