diff options
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os.zig | 17 | ||||
| -rw-r--r-- | lib/std/os/uefi/protocols/file_protocol.zig | 4 | ||||
| -rw-r--r-- | lib/std/os/windows.zig | 67 | ||||
| -rw-r--r-- | lib/std/os/windows/user32.zig | 913 | ||||
| -rw-r--r-- | lib/std/packed_int_array.zig | 20 |
5 files changed, 995 insertions, 26 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index f33e206a65..601839ea1c 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2728,10 +2728,21 @@ pub const SocketError = error{ pub fn socket(domain: u32, socket_type: u32, protocol: u32) SocketError!socket_t { if (builtin.os.tag == .windows) { - // NOTE: windows translates the SOCK_NONBLOCK/SOCK_CLOEXEC flags into windows-analagous operations + // NOTE: windows translates the SOCK_NONBLOCK/SOCK_CLOEXEC flags into + // windows-analagous operations const filtered_sock_type = socket_type & ~@as(u32, SOCK_NONBLOCK | SOCK_CLOEXEC); - const flags: u32 = if ((socket_type & SOCK_CLOEXEC) != 0) windows.ws2_32.WSA_FLAG_NO_HANDLE_INHERIT else 0; - const rc = try windows.WSASocketW(@bitCast(i32, domain), @bitCast(i32, filtered_sock_type), @bitCast(i32, protocol), null, 0, flags); + const flags: u32 = if ((socket_type & SOCK_CLOEXEC) != 0) + windows.ws2_32.WSA_FLAG_NO_HANDLE_INHERIT + else + 0; + const rc = try windows.WSASocketW( + @bitCast(i32, domain), + @bitCast(i32, filtered_sock_type), + @bitCast(i32, protocol), + null, + 0, + flags, + ); errdefer windows.closesocket(rc) catch unreachable; if ((socket_type & SOCK_NONBLOCK) != 0) { var mode: c_ulong = 1; // nonblocking diff --git a/lib/std/os/uefi/protocols/file_protocol.zig b/lib/std/os/uefi/protocols/file_protocol.zig index 782ac70810..a1d001065c 100644 --- a/lib/std/os/uefi/protocols/file_protocol.zig +++ b/lib/std/os/uefi/protocols/file_protocol.zig @@ -49,11 +49,11 @@ pub const FileProtocol = extern struct { return self._set_position(self, position); } - pub fn getInfo(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: *usize, buffer: [*]u8) Status { + pub fn getInfo(self: *const FileProtocol, information_type: *align(8) const Guid, buffer_size: *usize, buffer: [*]u8) Status { return self._get_info(self, information_type, buffer_size, buffer); } - pub fn setInfo(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: usize, buffer: [*]const u8) Status { + pub fn setInfo(self: *const FileProtocol, information_type: *align(8) const Guid, buffer_size: usize, buffer: [*]const u8) Status { return self._set_info(self, information_type, buffer_size, buffer); } diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index db261c0ecc..9d898dadaf 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -1261,7 +1261,7 @@ pub fn WSAStartup(majorVersion: u8, minorVersion: u8) !ws2_32.WSADATA { .WSASYSNOTREADY => return error.SystemNotAvailable, .WSAVERNOTSUPPORTED => return error.VersionNotSupported, .WSAEINPROGRESS => return error.BlockingOperationInProgress, - .WSAEPROCLIM => return error.SystemResources, + .WSAEPROCLIM => return error.ProcessFdQuotaExceeded, else => |err| return unexpectedWSAError(err), }, }; @@ -1280,6 +1280,30 @@ pub fn WSACleanup() !void { }; } +var wsa_startup_mutex: std.Thread.Mutex = .{}; + +/// Microsoft requires WSAStartup to be called to initialize, or else +/// WSASocketW will return WSANOTINITIALISED. +/// Since this is a standard library, we do not have the luxury of +/// putting initialization code anywhere, because we would not want +/// to pay the cost of calling WSAStartup if there ended up being no +/// networking. Also, if Zig code is used as a library, Zig is not in +/// charge of the start code, and we couldn't put in any initialization +/// code even if we wanted to. +/// The documentation for WSAStartup mentions that there must be a +/// matching WSACleanup call. It is not possible for the Zig Standard +/// Library to honor this for the same reason - there is nowhere to put +/// deinitialization code. +/// So, API users of the zig std lib have two options: +/// * (recommended) The simple, cross-platform way: just call `WSASocketW` +/// and don't worry about it. Zig will call WSAStartup() in a thread-safe +/// manner and never deinitialize networking. This is ideal for an +/// application which has the capability to do networking. +/// * The getting-your-hands-dirty way: call `WSAStartup()` before doing +/// networking, so that the error handling code for WSANOTINITIALISED never +/// gets run, which then allows the application or library to call `WSACleanup()`. +/// This could make sense for a library, which has init and deinit +/// functions for the whole library's lifetime. pub fn WSASocketW( af: i32, socket_type: i32, @@ -1288,17 +1312,40 @@ pub fn WSASocketW( g: ws2_32.GROUP, dwFlags: DWORD, ) !ws2_32.SOCKET { - const rc = ws2_32.WSASocketW(af, socket_type, protocol, protocolInfo, g, dwFlags); - if (rc == ws2_32.INVALID_SOCKET) { - switch (ws2_32.WSAGetLastError()) { - .WSAEAFNOSUPPORT => return error.AddressFamilyNotSupported, - .WSAEMFILE => return error.ProcessFdQuotaExceeded, - .WSAENOBUFS => return error.SystemResources, - .WSAEPROTONOSUPPORT => return error.ProtocolNotSupported, - else => |err| return unexpectedWSAError(err), + var first = true; + while (true) { + const rc = ws2_32.WSASocketW(af, socket_type, protocol, protocolInfo, g, dwFlags); + if (rc == ws2_32.INVALID_SOCKET) { + switch (ws2_32.WSAGetLastError()) { + .WSAEAFNOSUPPORT => return error.AddressFamilyNotSupported, + .WSAEMFILE => return error.ProcessFdQuotaExceeded, + .WSAENOBUFS => return error.SystemResources, + .WSAEPROTONOSUPPORT => return error.ProtocolNotSupported, + .WSANOTINITIALISED => { + if (!first) return error.Unexpected; + first = false; + + var held = wsa_startup_mutex.acquire(); + defer held.release(); + + // Here we could use a flag to prevent multiple threads to prevent + // multiple calls to WSAStartup, but it doesn't matter. We're globally + // leaking the resource intentionally, and the mutex already prevents + // data races within the WSAStartup function. + _ = WSAStartup(2, 2) catch |err| switch (err) { + error.SystemNotAvailable => return error.SystemResources, + error.VersionNotSupported => return error.Unexpected, + error.BlockingOperationInProgress => return error.Unexpected, + error.ProcessFdQuotaExceeded => return error.ProcessFdQuotaExceeded, + error.Unexpected => return error.Unexpected, + }; + continue; + }, + else => |err| return unexpectedWSAError(err), + } } + return rc; } - return rc; } pub fn bind(s: ws2_32.SOCKET, name: *const ws2_32.sockaddr, namelen: ws2_32.socklen_t) i32 { diff --git a/lib/std/os/windows/user32.zig b/lib/std/os/windows/user32.zig index 4694be6ece..0138f22546 100644 --- a/lib/std/os/windows/user32.zig +++ b/lib/std/os/windows/user32.zig @@ -35,10 +35,10 @@ pub const MSG = extern struct { lPrivate: DWORD, }; +// Compiled by the WINE team @ https://wiki.winehq.org/List_Of_Windows_Messages pub const WM_NULL = 0x0000; pub const WM_CREATE = 0x0001; pub const WM_DESTROY = 0x0002; -pub const WM_NCDESTROY = WM_DESTROY; pub const WM_MOVE = 0x0003; pub const WM_SIZE = 0x0005; pub const WM_ACTIVATE = 0x0006; @@ -51,11 +51,29 @@ pub const WM_GETTEXT = 0x000D; pub const WM_GETTEXTLENGTH = 0x000E; pub const WM_PAINT = 0x000F; pub const WM_CLOSE = 0x0010; +pub const WM_QUERYENDSESSION = 0x0011; pub const WM_QUIT = 0x0012; +pub const WM_QUERYOPEN = 0x0013; pub const WM_ERASEBKGND = 0x0014; +pub const WM_SYSCOLORCHANGE = 0x0015; +pub const WM_ENDSESSION = 0x0016; pub const WM_SHOWWINDOW = 0x0018; pub const WM_CTLCOLOR = 0x0019; +pub const WM_WININICHANGE = 0x001A; +pub const WM_DEVMODECHANGE = 0x001B; +pub const WM_ACTIVATEAPP = 0x001C; +pub const WM_FONTCHANGE = 0x001D; +pub const WM_TIMECHANGE = 0x001E; +pub const WM_CANCELMODE = 0x001F; +pub const WM_SETCURSOR = 0x0020; +pub const WM_MOUSEACTIVATE = 0x0021; +pub const WM_CHILDACTIVATE = 0x0022; +pub const WM_QUEUESYNC = 0x0023; +pub const WM_GETMINMAXINFO = 0x0024; +pub const WM_PAINTICON = 0x0026; +pub const WM_ICONERASEBKGND = 0x0027; pub const WM_NEXTDLGCTL = 0x0028; +pub const WM_SPOOLERSTATUS = 0x002A; pub const WM_DRAWITEM = 0x002B; pub const WM_MEASUREITEM = 0x002C; pub const WM_DELETEITEM = 0x002D; @@ -63,13 +81,40 @@ pub const WM_VKEYTOITEM = 0x002E; pub const WM_CHARTOITEM = 0x002F; pub const WM_SETFONT = 0x0030; pub const WM_GETFONT = 0x0031; +pub const WM_SETHOTKEY = 0x0032; +pub const WM_GETHOTKEY = 0x0033; +pub const WM_QUERYDRAGICON = 0x0037; pub const WM_COMPAREITEM = 0x0039; +pub const WM_GETOBJECT = 0x003D; +pub const WM_COMPACTING = 0x0041; +pub const WM_COMMNOTIFY = 0x0044; +pub const WM_WINDOWPOSCHANGING = 0x0046; pub const WM_WINDOWPOSCHANGED = 0x0047; +pub const WM_POWER = 0x0048; +pub const WM_COPYGLOBALDATA = 0x0049; +pub const WM_COPYDATA = 0x004A; +pub const WM_CANCELJOURNAL = 0x004B; pub const WM_NOTIFY = 0x004E; +pub const WM_INPUTLANGCHANGEREQUEST = 0x0050; +pub const WM_INPUTLANGCHANGE = 0x0051; +pub const WM_TCARD = 0x0052; +pub const WM_HELP = 0x0053; +pub const WM_USERCHANGED = 0x0054; +pub const WM_NOTIFYFORMAT = 0x0055; +pub const WM_CONTEXTMENU = 0x007B; +pub const WM_STYLECHANGING = 0x007C; +pub const WM_STYLECHANGED = 0x007D; +pub const WM_DISPLAYCHANGE = 0x007E; +pub const WM_GETICON = 0x007F; +pub const WM_SETICON = 0x0080; +pub const WM_NCCREATE = 0x0081; +pub const WM_NCDESTROY = 0x0082; pub const WM_NCCALCSIZE = 0x0083; pub const WM_NCHITTEST = 0x0084; pub const WM_NCPAINT = 0x0085; +pub const WM_NCACTIVATE = 0x0086; pub const WM_GETDLGCODE = 0x0087; +pub const WM_SYNCPAINT = 0x0088; pub const WM_NCMOUSEMOVE = 0x00A0; pub const WM_NCLBUTTONDOWN = 0x00A1; pub const WM_NCLBUTTONUP = 0x00A2; @@ -77,7 +122,72 @@ pub const WM_NCLBUTTONDBLCLK = 0x00A3; pub const WM_NCRBUTTONDOWN = 0x00A4; pub const WM_NCRBUTTONUP = 0x00A5; pub const WM_NCRBUTTONDBLCLK = 0x00A6; -pub const WM_KEYFIRST = 0x0100; +pub const WM_NCMBUTTONDOWN = 0x00A7; +pub const WM_NCMBUTTONUP = 0x00A8; +pub const WM_NCMBUTTONDBLCLK = 0x00A9; +pub const WM_NCXBUTTONDOWN = 0x00AB; +pub const WM_NCXBUTTONUP = 0x00AC; +pub const WM_NCXBUTTONDBLCLK = 0x00AD; +pub const EM_GETSEL = 0x00B0; +pub const EM_SETSEL = 0x00B1; +pub const EM_GETRECT = 0x00B2; +pub const EM_SETRECT = 0x00B3; +pub const EM_SETRECTNP = 0x00B4; +pub const EM_SCROLL = 0x00B5; +pub const EM_LINESCROLL = 0x00B6; +pub const EM_SCROLLCARET = 0x00B7; +pub const EM_GETMODIFY = 0x00B8; +pub const EM_SETMODIFY = 0x00B9; +pub const EM_GETLINECOUNT = 0x00BA; +pub const EM_LINEINDEX = 0x00BB; +pub const EM_SETHANDLE = 0x00BC; +pub const EM_GETHANDLE = 0x00BD; +pub const EM_GETTHUMB = 0x00BE; +pub const EM_LINELENGTH = 0x00C1; +pub const EM_REPLACESEL = 0x00C2; +pub const EM_SETFONT = 0x00C3; +pub const EM_GETLINE = 0x00C4; +pub const EM_LIMITTEXT = 0x00C5; +pub const EM_SETLIMITTEXT = 0x00C5; +pub const EM_CANUNDO = 0x00C6; +pub const EM_UNDO = 0x00C7; +pub const EM_FMTLINES = 0x00C8; +pub const EM_LINEFROMCHAR = 0x00C9; +pub const EM_SETWORDBREAK = 0x00CA; +pub const EM_SETTABSTOPS = 0x00CB; +pub const EM_SETPASSWORDCHAR = 0x00CC; +pub const EM_EMPTYUNDOBUFFER = 0x00CD; +pub const EM_GETFIRSTVISIBLELINE = 0x00CE; +pub const EM_SETREADONLY = 0x00CF; +pub const EM_SETWORDBREAKPROC = 0x00D0; +pub const EM_GETWORDBREAKPROC = 0x00D1; +pub const EM_GETPASSWORDCHAR = 0x00D2; +pub const EM_SETMARGINS = 0x00D3; +pub const EM_GETMARGINS = 0x00D4; +pub const EM_GETLIMITTEXT = 0x00D5; +pub const EM_POSFROMCHAR = 0x00D6; +pub const EM_CHARFROMPOS = 0x00D7; +pub const EM_SETIMESTATUS = 0x00D8; +pub const EM_GETIMESTATUS = 0x00D9; +pub const SBM_SETPOS = 0x00E0; +pub const SBM_GETPOS = 0x00E1; +pub const SBM_SETRANGE = 0x00E2; +pub const SBM_GETRANGE = 0x00E3; +pub const SBM_ENABLE_ARROWS = 0x00E4; +pub const SBM_SETRANGEREDRAW = 0x00E6; +pub const SBM_SETSCROLLINFO = 0x00E9; +pub const SBM_GETSCROLLINFO = 0x00EA; +pub const SBM_GETSCROLLBARINFO = 0x00EB; +pub const BM_GETCHECK = 0x00F0; +pub const BM_SETCHECK = 0x00F1; +pub const BM_GETSTATE = 0x00F2; +pub const BM_SETSTATE = 0x00F3; +pub const BM_SETSTYLE = 0x00F4; +pub const BM_CLICK = 0x00F5; +pub const BM_GETIMAGE = 0x00F6; +pub const BM_SETIMAGE = 0x00F7; +pub const BM_SETDONTCLICK = 0x00F8; +pub const WM_INPUT = 0x00FF; pub const WM_KEYDOWN = 0x0100; pub const WM_KEYUP = 0x0101; pub const WM_CHAR = 0x0102; @@ -87,14 +197,33 @@ pub const WM_SYSKEYUP = 0x0105; pub const WM_SYSCHAR = 0x0106; pub const WM_SYSDEADCHAR = 0x0107; pub const WM_UNICHAR = 0x0109; -pub const WM_KEYLAST = 0x0109; +pub const WM_WNT_CONVERTREQUESTEX = 0x0109; +pub const WM_CONVERTREQUEST = 0x010A; +pub const WM_CONVERTRESULT = 0x010B; +pub const WM_INTERIM = 0x010C; +pub const WM_IME_STARTCOMPOSITION = 0x010D; +pub const WM_IME_ENDCOMPOSITION = 0x010E; +pub const WM_IME_COMPOSITION = 0x010F; pub const WM_INITDIALOG = 0x0110; pub const WM_COMMAND = 0x0111; pub const WM_SYSCOMMAND = 0x0112; pub const WM_TIMER = 0x0113; pub const WM_HSCROLL = 0x0114; pub const WM_VSCROLL = 0x0115; +pub const WM_INITMENU = 0x0116; +pub const WM_INITMENUPOPUP = 0x0117; +pub const WM_SYSTIMER = 0x0118; +pub const WM_MENUSELECT = 0x011F; +pub const WM_MENUCHAR = 0x0120; pub const WM_ENTERIDLE = 0x0121; +pub const WM_MENURBUTTONUP = 0x0122; +pub const WM_MENUDRAG = 0x0123; +pub const WM_MENUGETOBJECT = 0x0124; +pub const WM_UNINITMENUPOPUP = 0x0125; +pub const WM_MENUCOMMAND = 0x0126; +pub const WM_CHANGEUISTATE = 0x0127; +pub const WM_UPDATEUISTATE = 0x0128; +pub const WM_QUERYUISTATE = 0x0129; pub const WM_CTLCOLORMSGBOX = 0x0132; pub const WM_CTLCOLOREDIT = 0x0133; pub const WM_CTLCOLORLISTBOX = 0x0134; @@ -102,7 +231,6 @@ pub const WM_CTLCOLORBTN = 0x0135; pub const WM_CTLCOLORDLG = 0x0136; pub const WM_CTLCOLORSCROLLBAR = 0x0137; pub const WM_CTLCOLORSTATIC = 0x0138; -pub const WM_MOUSEFIRST = 0x0200; pub const WM_MOUSEMOVE = 0x0200; pub const WM_LBUTTONDOWN = 0x0201; pub const WM_LBUTTONUP = 0x0202; @@ -114,15 +242,790 @@ pub const WM_MBUTTONDOWN = 0x0207; pub const WM_MBUTTONUP = 0x0208; pub const WM_MBUTTONDBLCLK = 0x0209; pub const WM_MOUSEWHEEL = 0x020A; -pub const WM_MOUSELAST = 0x020A; +pub const WM_XBUTTONDOWN = 0x020B; +pub const WM_XBUTTONUP = 0x020C; +pub const WM_XBUTTONDBLCLK = 0x020D; +pub const WM_MOUSEHWHEEL = 0x020E; +pub const WM_PARENTNOTIFY = 0x0210; +pub const WM_ENTERMENULOOP = 0x0211; +pub const WM_EXITMENULOOP = 0x0212; +pub const WM_NEXTMENU = 0x0213; +pub const WM_SIZING = 0x0214; +pub const WM_CAPTURECHANGED = 0x0215; +pub const WM_MOVING = 0x0216; +pub const WM_POWERBROADCAST = 0x0218; +pub const WM_DEVICECHANGE = 0x0219; +pub const WM_MDICREATE = 0x0220; +pub const WM_MDIDESTROY = 0x0221; +pub const WM_MDIACTIVATE = 0x0222; +pub const WM_MDIRESTORE = 0x0223; +pub const WM_MDINEXT = 0x0224; +pub const WM_MDIMAXIMIZE = 0x0225; +pub const WM_MDITILE = 0x0226; +pub const WM_MDICASCADE = 0x0227; +pub const WM_MDIICONARRANGE = 0x0228; +pub const WM_MDIGETACTIVE = 0x0229; +pub const WM_MDISETMENU = 0x0230; +pub const WM_ENTERSIZEMOVE = 0x0231; +pub const WM_EXITSIZEMOVE = 0x0232; +pub const WM_DROPFILES = 0x0233; +pub const WM_MDIREFRESHMENU = 0x0234; +pub const WM_IME_REPORT = 0x0280; +pub const WM_IME_SETCONTEXT = 0x0281; +pub const WM_IME_NOTIFY = 0x0282; +pub const WM_IME_CONTROL = 0x0283; +pub const WM_IME_COMPOSITIONFULL = 0x0284; +pub const WM_IME_SELECT = 0x0285; +pub const WM_IME_CHAR = 0x0286; +pub const WM_IME_REQUEST = 0x0288; +pub const WM_IMEKEYDOWN = 0x0290; +pub const WM_IME_KEYDOWN = 0x0290; +pub const WM_IMEKEYUP = 0x0291; +pub const WM_IME_KEYUP = 0x0291; +pub const WM_NCMOUSEHOVER = 0x02A0; +pub const WM_MOUSEHOVER = 0x02A1; +pub const WM_NCMOUSELEAVE = 0x02A2; +pub const WM_MOUSELEAVE = 0x02A3; +pub const WM_CUT = 0x0300; +pub const WM_COPY = 0x0301; +pub const WM_PASTE = 0x0302; +pub const WM_CLEAR = 0x0303; +pub const WM_UNDO = 0x0304; +pub const WM_RENDERFORMAT = 0x0305; +pub const WM_RENDERALLFORMATS = 0x0306; +pub const WM_DESTROYCLIPBOARD = 0x0307; +pub const WM_DRAWCLIPBOARD = 0x0308; +pub const WM_PAINTCLIPBOARD = 0x0309; +pub const WM_VSCROLLCLIPBOARD = 0x030A; +pub const WM_SIZECLIPBOARD = 0x030B; +pub const WM_ASKCBFORMATNAME = 0x030C; +pub const WM_CHANGECBCHAIN = 0x030D; +pub const WM_HSCROLLCLIPBOARD = 0x030E; +pub const WM_QUERYNEWPALETTE = 0x030F; +pub const WM_PALETTEISCHANGING = 0x0310; +pub const WM_PALETTECHANGED = 0x0311; pub const WM_HOTKEY = 0x0312; +pub const WM_PRINT = 0x0317; +pub const WM_PRINTCLIENT = 0x0318; +pub const WM_APPCOMMAND = 0x0319; +pub const WM_RCRESULT = 0x0381; +pub const WM_HOOKRCRESULT = 0x0382; +pub const WM_GLOBALRCCHANGE = 0x0383; +pub const WM_PENMISCINFO = 0x0383; +pub const WM_SKB = 0x0384; +pub const WM_HEDITCTL = 0x0385; +pub const WM_PENCTL = 0x0385; +pub const WM_PENMISC = 0x0386; +pub const WM_CTLINIT = 0x0387; +pub const WM_PENEVENT = 0x0388; pub const WM_CARET_CREATE = 0x03E0; pub const WM_CARET_DESTROY = 0x03E1; pub const WM_CARET_BLINK = 0x03E2; pub const WM_FDINPUT = 0x03F0; pub const WM_FDOUTPUT = 0x03F1; pub const WM_FDEXCEPT = 0x03F2; +pub const DDM_SETFMT = 0x0400; +pub const DM_GETDEFID = 0x0400; +pub const NIN_SELECT = 0x0400; +pub const TBM_GETPOS = 0x0400; +pub const WM_PSD_PAGESETUPDLG = 0x0400; pub const WM_USER = 0x0400; +pub const CBEM_INSERTITEMA = 0x0401; +pub const DDM_DRAW = 0x0401; +pub const DM_SETDEFID = 0x0401; +pub const HKM_SETHOTKEY = 0x0401; +pub const PBM_SETRANGE = 0x0401; +pub const RB_INSERTBANDA = 0x0401; +pub const SB_SETTEXTA = 0x0401; +pub const TB_ENABLEBUTTON = 0x0401; +pub const TBM_GETRANGEMIN = 0x0401; +pub const TTM_ACTIVATE = 0x0401; +pub const WM_CHOOSEFONT_GETLOGFONT = 0x0401; +pub const WM_PSD_FULLPAGERECT = 0x0401; +pub const CBEM_SETIMAGELIST = 0x0402; +pub const DDM_CLOSE = 0x0402; +pub const DM_REPOSITION = 0x0402; +pub const HKM_GETHOTKEY = 0x0402; +pub const PBM_SETPOS = 0x0402; +pub const RB_DELETEBAND = 0x0402; +pub const SB_GETTEXTA = 0x0402; +pub const TB_CHECKBUTTON = 0x0402; +pub const TBM_GETRANGEMAX = 0x0402; +pub const WM_PSD_MINMARGINRECT = 0x0402; +pub const CBEM_GETIMAGELIST = 0x0403; +pub const DDM_BEGIN = 0x0403; +pub const HKM_SETRULES = 0x0403; +pub const PBM_DELTAPOS = 0x0403; +pub const RB_GETBARINFO = 0x0403; +pub const SB_GETTEXTLENGTHA = 0x0403; +pub const TBM_GETTIC = 0x0403; +pub const TB_PRESSBUTTON = 0x0403; +pub const TTM_SETDELAYTIME = 0x0403; +pub const WM_PSD_MARGINRECT = 0x0403; +pub const CBEM_GETITEMA = 0x0404; +pub const DDM_END = 0x0404; +pub const PBM_SETSTEP = 0x0404; +pub const RB_SETBARINFO = 0x0404; +pub const SB_SETPARTS = 0x0404; +pub const TB_HIDEBUTTON = 0x0404; +pub const TBM_SETTIC = 0x0404; +pub const TTM_ADDTOOLA = 0x0404; +pub const WM_PSD_GREEKTEXTRECT = 0x0404; +pub const CBEM_SETITEMA = 0x0405; +pub const PBM_STEPIT = 0x0405; +pub const TB_INDETERMINATE = 0x0405; +pub const TBM_SETPOS = 0x0405; +pub const TTM_DELTOOLA = 0x0405; +pub const WM_PSD_ENVSTAMPRECT = 0x0405; +pub const CBEM_GETCOMBOCONTROL = 0x0406; +pub const PBM_SETRANGE32 = 0x0406; +pub const RB_SETBANDINFOA = 0x0406; +pub const SB_GETPARTS = 0x0406; +pub const TB_MARKBUTTON = 0x0406; +pub const TBM_SETRANGE = 0x0406; +pub const TTM_NEWTOOLRECTA = 0x0406; +pub const WM_PSD_YAFULLPAGERECT = 0x0406; +pub const CBEM_GETEDITCONTROL = 0x0407; +pub const PBM_GETRANGE = 0x0407; +pub const RB_SETPARENT = 0x0407; +pub const SB_GETBORDERS = 0x0407; +pub const TBM_SETRANGEMIN = 0x0407; +pub const TTM_RELAYEVENT = 0x0407; +pub const CBEM_SETEXSTYLE = 0x0408; +pub const PBM_GETPOS = 0x0408; +pub const RB_HITTEST = 0x0408; +pub const SB_SETMINHEIGHT = 0x0408; +pub const TBM_SETRANGEMAX = 0x0408; +pub const TTM_GETTOOLINFOA = 0x0408; +pub const CBEM_GETEXSTYLE = 0x0409; +pub const CBEM_GETEXTENDEDSTYLE = 0x0409; +pub const PBM_SETBARCOLOR = 0x0409; +pub const RB_GETRECT = 0x0409; +pub const SB_SIMPLE = 0x0409; +pub const TB_ISBUTTONENABLED = 0x0409; +pub const TBM_CLEARTICS = 0x0409; +pub const TTM_SETTOOLINFOA = 0x0409; +pub const CBEM_HASEDITCHANGED = 0x040A; +pub const RB_INSERTBANDW = 0x040A; +pub const SB_GETRECT = 0x040A; +pub const TB_ISBUTTONCHECKED = 0x040A; +pub const TBM_SETSEL = 0x040A; +pub const TTM_HITTESTA = 0x040A; +pub const WIZ_QUERYNUMPAGES = 0x040A; +pub const CBEM_INSERTITEMW = 0x040B; +pub const RB_SETBANDINFOW = 0x040B; +pub const SB_SETTEXTW = 0x040B; +pub const TB_ISBUTTONPRESSED = 0x040B; +pub const TBM_SETSELSTART = 0x040B; +pub const TTM_GETTEXTA = 0x040B; +pub const WIZ_NEXT = 0x040B; +pub const CBEM_SETITEMW = 0x040C; +pub const RB_GETBANDCOUNT = 0x040C; +pub const SB_GETTEXTLENGTHW = 0x040C; +pub const TB_ISBUTTONHIDDEN = 0x040C; +pub const TBM_SETSELEND = 0x040C; +pub const TTM_UPDATETIPTEXTA = 0x040C; +pub const WIZ_PREV = 0x040C; +pub const CBEM_GETITEMW = 0x040D; +pub const RB_GETROWCOUNT = 0x040D; +pub const SB_GETTEXTW = 0x040D; +pub const TB_ISBUTTONINDETERMINATE = 0x040D; +pub const TTM_GETTOOLCOUNT = 0x040D; +pub const CBEM_SETEXTENDEDSTYLE = 0x040E; +pub const RB_GETROWHEIGHT = 0x040E; +pub const SB_ISSIMPLE = 0x040E; +pub const TB_ISBUTTONHIGHLIGHTED = 0x040E; +pub const TBM_GETPTICS = 0x040E; +pub const TTM_ENUMTOOLSA = 0x040E; +pub const SB_SETICON = 0x040F; +pub const TBM_GETTICPOS = 0x040F; +pub const TTM_GETCURRENTTOOLA = 0x040F; +pub const RB_IDTOINDEX = 0x0410; +pub const SB_SETTIPTEXTA = 0x0410; +pub const TBM_GETNUMTICS = 0x0410; +pub const TTM_WINDOWFROMPOINT = 0x0410; +pub const RB_GETTOOLTIPS = 0x0411; +pub const SB_SETTIPTEXTW = 0x0411; +pub const TBM_GETSELSTART = 0x0411; +pub const TB_SETSTATE = 0x0411; +pub const TTM_TRACKACTIVATE = 0x0411; +pub const RB_SETTOOLTIPS = 0x0412; +pub const SB_GETTIPTEXTA = 0x0412; +pub const TB_GETSTATE = 0x0412; +pub const TBM_GETSELEND = 0x0412; +pub const TTM_TRACKPOSITION = 0x0412; +pub const RB_SETBKCOLOR = 0x0413; +pub const SB_GETTIPTEXTW = 0x0413; +pub const TB_ADDBITMAP = 0x0413; +pub const TBM_CLEARSEL = 0x0413; +pub const TTM_SETTIPBKCOLOR = 0x0413; +pub const RB_GETBKCOLOR = 0x0414; +pub const SB_GETICON = 0x0414; +pub const TB_ADDBUTTONSA = 0x0414; +pub const TBM_SETTICFREQ = 0x0414; +pub const TTM_SETTIPTEXTCOLOR = 0x0414; +pub const RB_SETTEXTCOLOR = 0x0415; +pub const TB_INSERTBUTTONA = 0x0415; +pub const TBM_SETPAGESIZE = 0x0415; +pub const TTM_GETDELAYTIME = 0x0415; +pub const RB_GETTEXTCOLOR = 0x0416; +pub const TB_DELETEBUTTON = 0x0416; +pub const TBM_GETPAGESIZE = 0x0416; +pub const TTM_GETTIPBKCOLOR = 0x0416; +pub const RB_SIZETORECT = 0x0417; +pub const TB_GETBUTTON = 0x0417; +pub const TBM_SETLINESIZE = 0x0417; +pub const TTM_GETTIPTEXTCOLOR = 0x0417; +pub const RB_BEGINDRAG = 0x0418; +pub const TB_BUTTONCOUNT = 0x0418; +pub const TBM_GETLINESIZE = 0x0418; +pub const TTM_SETMAXTIPWIDTH = 0x0418; +pub const RB_ENDDRAG = 0x0419; +pub const TB_COMMANDTOINDEX = 0x0419; +pub const TBM_GETTHUMBRECT = 0x0419; +pub const TTM_GETMAXTIPWIDTH = 0x0419; +pub const RB_DRAGMOVE = 0x041A; +pub const TBM_GETCHANNELRECT = 0x041A; +pub const TB_SAVERESTOREA = 0x041A; +pub const TTM_SETMARGIN = 0x041A; +pub const RB_GETBARHEIGHT = 0x041B; +pub const TB_CUSTOMIZE = 0x041B; +pub const TBM_SETTHUMBLENGTH = 0x041B; +pub const TTM_GETMARGIN = 0x041B; +pub const RB_GETBANDINFOW = 0x041C; +pub const TB_ADDSTRINGA = 0x041C; +pub const TBM_GETTHUMBLENGTH = 0x041C; +pub const TTM_POP = 0x041C; +pub const RB_GETBANDINFOA = 0x041D; +pub const TB_GETITEMRECT = 0x041D; +pub const TBM_SETTOOLTIPS = 0x041D; +pub const TTM_UPDATE = 0x041D; +pub const RB_MINIMIZEBAND = 0x041E; +pub const TB_BUTTONSTRUCTSIZE = 0x041E; +pub const TBM_GETTOOLTIPS = 0x041E; +pub const TTM_GETBUBBLESIZE = 0x041E; +pub const RB_MAXIMIZEBAND = 0x041F; +pub const TBM_SETTIPSIDE = 0x041F; +pub const TB_SETBUTTONSIZE = 0x041F; +pub const TTM_ADJUSTRECT = 0x041F; +pub const TBM_SETBUDDY = 0x0420; +pub const TB_SETBITMAPSIZE = 0x0420; +pub const TTM_SETTITLEA = 0x0420; +pub const MSG_FTS_JUMP_VA = 0x0421; +pub const TB_AUTOSIZE = 0x0421; +pub const TBM_GETBUDDY = 0x0421; +pub const TTM_SETTITLEW = 0x0421; +pub const RB_GETBANDBORDERS = 0x0422; +pub const MSG_FTS_JUMP_QWORD = 0x0423; +pub const RB_SHOWBAND = 0x0423; +pub const TB_GETTOOLTIPS = 0x0423; +pub const MSG_REINDEX_REQUEST = 0x0424; +pub const TB_SETTOOLTIPS = 0x0424; +pub const MSG_FTS_WHERE_IS_IT = 0x0425; +pub const RB_SETPALETTE = 0x0425; +pub const TB_SETPARENT = 0x0425; +pub const RB_GETPALETTE = 0x0426; +pub const RB_MOVEBAND = 0x0427; +pub const TB_SETROWS = 0x0427; +pub const TB_GETROWS = 0x0428; +pub const TB_GETBITMAPFLAGS = 0x0429; +pub const TB_SETCMDID = 0x042A; +pub const RB_PUSHCHEVRON = 0x042B; +pub const TB_CHANGEBITMAP = 0x042B; +pub const TB_GETBITMAP = 0x042C; +pub const MSG_GET_DEFFONT = 0x042D; +pub const TB_GETBUTTONTEXTA = 0x042D; +pub const TB_REPLACEBITMAP = 0x042E; +pub const TB_SETINDENT = 0x042F; +pub const TB_SETIMAGELIST = 0x0430; +pub const TB_GETIMAGELIST = 0x0431; +pub const TB_LOADIMAGES = 0x0432; +pub const EM_CANPASTE = 0x0432; +pub const TTM_ADDTOOLW = 0x0432; +pub const EM_DISPLAYBAND = 0x0433; +pub const TB_GETRECT = 0x0433; +pub const TTM_DELTOOLW = 0x0433; +pub const EM_EXGETSEL = 0x0434; +pub const TB_SETHOTIMAGELIST = 0x0434; +pub const TTM_NEWTOOLRECTW = 0x0434; +pub const EM_EXLIMITTEXT = 0x0435; +pub const TB_GETHOTIMAGELIST = 0x0435; +pub const TTM_GETTOOLINFOW = 0x0435; +pub const EM_EXLINEFROMCHAR = 0x0436; +pub const TB_SETDISABLEDIMAGELIST = 0x0436; +pub const TTM_SETTOOLINFOW = 0x0436; +pub const EM_EXSETSEL = 0x0437; +pub const TB_GETDISABLEDIMAGELIST = 0x0437; +pub const TTM_HITTESTW = 0x0437; +pub const EM_FINDTEXT = 0x0438; +pub const TB_SETSTYLE = 0x0438; +pub const TTM_GETTEXTW = 0x0438; +pub const EM_FORMATRANGE = 0x0439; +pub const TB_GETSTYLE = 0x0439; +pub const TTM_UPDATETIPTEXTW = 0x0439; +pub const EM_GETCHARFORMAT = 0x043A; +pub const TB_GETBUTTONSIZE = 0x043A; +pub const TTM_ENUMTOOLSW = 0x043A; +pub const EM_GETEVENTMASK = 0x043B; +pub const TB_SETBUTTONWIDTH = 0x043B; +pub const TTM_GETCURRENTTOOLW = 0x043B; +pub const EM_GETOLEINTERFACE = 0x043C; +pub const TB_SETMAXTEXTROWS = 0x043C; +pub const EM_GETPARAFORMAT = 0x043D; +pub const TB_GETTEXTROWS = 0x043D; +pub const EM_GETSELTEXT = 0x043E; +pub const TB_GETOBJECT = 0x043E; +pub const EM_HIDESELECTION = 0x043F; +pub const TB_GETBUTTONINFOW = 0x043F; +pub const EM_PASTESPECIAL = 0x0440; +pub const TB_SETBUTTONINFOW = 0x0440; +pub const EM_REQUESTRESIZE = 0x0441; +pub const TB_GETBUTTONINFOA = 0x0441; +pub const EM_SELECTIONTYPE = 0x0442; +pub const TB_SETBUTTONINFOA = 0x0442; +pub const EM_SETBKGNDCOLOR = 0x0443; +pub const TB_INSERTBUTTONW = 0x0443; +pub const EM_SETCHARFORMAT = 0x0444; +pub const TB_ADDBUTTONSW = 0x0444; +pub const EM_SETEVENTMASK = 0x0445; +pub const TB_HITTEST = 0x0445; +pub const EM_SETOLECALLBACK = 0x0446; +pub const TB_SETDRAWTEXTFLAGS = 0x0446; +pub const EM_SETPARAFORMAT = 0x0447; +pub const TB_GETHOTITEM = 0x0447; +pub const EM_SETTARGETDEVICE = 0x0448; +pub const TB_SETHOTITEM = 0x0448; +pub const EM_STREAMIN = 0x0449; +pub const TB_SETANCHORHIGHLIGHT = 0x0449; +pub const EM_STREAMOUT = 0x044A; +pub const TB_GETANCHORHIGHLIGHT = 0x044A; +pub const EM_GETTEXTRANGE = 0x044B; +pub const TB_GETBUTTONTEXTW = 0x044B; +pub const EM_FINDWORDBREAK = 0x044C; +pub const TB_SAVERESTOREW = 0x044C; +pub const EM_SETOPTIONS = 0x044D; +pub const TB_ADDSTRINGW = 0x044D; +pub const EM_GETOPTIONS = 0x044E; +pub const TB_MAPACCELERATORA = 0x044E; +pub const EM_FINDTEXTEX = 0x044F; +pub const TB_GETINSERTMARK = 0x044F; +pub const EM_GETWORDBREAKPROCEX = 0x0450; +pub const TB_SETINSERTMARK = 0x0450; +pub const EM_SETWORDBREAKPROCEX = 0x0451; +pub const TB_INSERTMARKHITTEST = 0x0451; +pub const EM_SETUNDOLIMIT = 0x0452; +pub const TB_MOVEBUTTON = 0x0452; +pub const TB_GETMAXSIZE = 0x0453; +pub const EM_REDO = 0x0454; +pub const TB_SETEXTENDEDSTYLE = 0x0454; +pub const EM_CANREDO = 0x0455; +pub const TB_GETEXTENDEDSTYLE = 0x0455; +pub const EM_GETUNDONAME = 0x0456; +pub const TB_GETPADDING = 0x0456; +pub const EM_GETREDONAME = 0x0457; +pub const TB_SETPADDING = 0x0457; +pub const EM_STOPGROUPTYPING = 0x0458; +pub const TB_SETINSERTMARKCOLOR = 0x0458; +pub const EM_SETTEXTMODE = 0x0459; +pub const TB_GETINSERTMARKCOLOR = 0x0459; +pub const EM_GETTEXTMODE = 0x045A; +pub const TB_MAPACCELERATORW = 0x045A; +pub const EM_AUTOURLDETECT = 0x045B; +pub const TB_GETSTRINGW = 0x045B; +pub const EM_GETAUTOURLDETECT = 0x045C; +pub const TB_GETSTRINGA = 0x045C; +pub const EM_SETPALETTE = 0x045D; +pub const EM_GETTEXTEX = 0x045E; +pub const EM_GETTEXTLENGTHEX = 0x045F; +pub const EM_SHOWSCROLLBAR = 0x0460; +pub const EM_SETTEXTEX = 0x0461; +pub const TAPI_REPLY = 0x0463; +pub const ACM_OPENA = 0x0464; +pub const BFFM_SETSTATUSTEXTA = 0x0464; +pub const CDM_GETSPEC = 0x0464; +pub const EM_SETPUNCTUATION = 0x0464; +pub const IPM_CLEARADDRESS = 0x0464; +pub const WM_CAP_UNICODE_START = 0x0464; +pub const ACM_PLAY = 0x0465; +pub const BFFM_ENABLEOK = 0x0465; +pub const CDM_GETFILEPATH = 0x0465; +pub const EM_GETPUNCTUATION = 0x0465; +pub const IPM_SETADDRESS = 0x0465; +pub const PSM_SETCURSEL = 0x0465; +pub const UDM_SETRANGE = 0x0465; +pub const WM_CHOOSEFONT_SETLOGFONT = 0x0465; +pub const ACM_STOP = 0x0466; +pub const BFFM_SETSELECTIONA = 0x0466; +pub const CDM_GETFOLDERPATH = 0x0466; +pub const EM_SETWORDWRAPMODE = 0x0466; +pub const IPM_GETADDRESS = 0x0466; +pub const PSM_REMOVEPAGE = 0x0466; +pub const UDM_GETRANGE = 0x0466; +pub const WM_CAP_SET_CALLBACK_ERRORW = 0x0466; +pub const WM_CHOOSEFONT_SETFLAGS = 0x0466; +pub const ACM_OPENW = 0x0467; +pub const BFFM_SETSELECTIONW = 0x0467; +pub const CDM_GETFOLDERIDLIST = 0x0467; +pub const EM_GETWORDWRAPMODE = 0x0467; +pub const IPM_SETRANGE = 0x0467; +pub const PSM_ADDPAGE = 0x0467; +pub const UDM_SETPOS = 0x0467; +pub const WM_CAP_SET_CALLBACK_STATUSW = 0x0467; +pub const BFFM_SETSTATUSTEXTW = 0x0468; +pub const CDM_SETCONTROLTEXT = 0x0468; +pub const EM_SETIMECOLOR = 0x0468; +pub const IPM_SETFOCUS = 0x0468; +pub const PSM_CHANGED = 0x0468; +pub const UDM_GETPOS = 0x0468; +pub const CDM_HIDECONTROL = 0x0469; +pub const EM_GETIMECOLOR = 0x0469; +pub const IPM_ISBLANK = 0x0469; +pub const PSM_RESTARTWINDOWS = 0x0469; +pub const UDM_SETBUDDY = 0x0469; +pub const CDM_SETDEFEXT = 0x046A; +pub const EM_SETIMEOPTIONS = 0x046A; +pub const PSM_REBOOTSYSTEM = 0x046A; +pub const UDM_GETBUDDY = 0x046A; +pub const EM_GETIMEOPTIONS = 0x046B; +pub const PSM_CANCELTOCLOSE = 0x046B; +pub const UDM_SETACCEL = 0x046B; +pub const EM_CONVPOSITION = 0x046C; +pub const PSM_QUERYSIBLINGS = 0x046C; +pub const UDM_GETACCEL = 0x046C; +pub const MCIWNDM_GETZOOM = 0x046D; +pub const PSM_UNCHANGED = 0x046D; +pub const UDM_SETBASE = 0x046D; +pub const PSM_APPLY = 0x046E; +pub const UDM_GETBASE = 0x046E; +pub const PSM_SETTITLEA = 0x046F; +pub const UDM_SETRANGE32 = 0x046F; +pub const PSM_SETWIZBUTTONS = 0x0470; +pub const UDM_GETRANGE32 = 0x0470; +pub const WM_CAP_DRIVER_GET_NAMEW = 0x0470; +pub const PSM_PRESSBUTTON = 0x0471; +pub const UDM_SETPOS32 = 0x0471; +pub const WM_CAP_DRIVER_GET_VERSIONW = 0x0471; +pub const PSM_SETCURSELID = 0x0472; +pub const UDM_GETPOS32 = 0x0472; +pub const PSM_SETFINISHTEXTA = 0x0473; +pub const PSM_GETTABCONTROL = 0x0474; +pub const PSM_ISDIALOGMESSAGE = 0x0475; +pub const MCIWNDM_REALIZE = 0x0476; +pub const PSM_GETCURRENTPAGEHWND = 0x0476; +pub const MCIWNDM_SETTIMEFORMATA = 0x0477; +pub const PSM_INSERTPAGE = 0x0477; +pub const EM_SETLANGOPTIONS = 0x0478; +pub const MCIWNDM_GETTIMEFORMATA = 0x0478; +pub const PSM_SETTITLEW = 0x0478; +pub const WM_CAP_FILE_SET_CAPTURE_FILEW = 0x0478; +pub const EM_GETLANGOPTIONS = 0x0479; +pub const MCIWNDM_VALIDATEMEDIA = 0x0479; +pub const PSM_SETFINISHTEXTW = 0x0479; +pub const WM_CAP_FILE_GET_CAPTURE_FILEW = 0x0479; +pub const EM_GETIMECOMPMODE = 0x047A; +pub const EM_FINDTEXTW = 0x047B; +pub const MCIWNDM_PLAYTO = 0x047B; +pub const WM_CAP_FILE_SAVEASW = 0x047B; +pub const EM_FINDTEXTEXW = 0x047C; +pub const MCIWNDM_GETFILENAMEA = 0x047C; +pub const EM_RECONVERSION = 0x047D; +pub const MCIWNDM_GETDEVICEA = 0x047D; +pub const PSM_SETHEADERTITLEA = 0x047D; +pub const WM_CAP_FILE_SAVEDIBW = 0x047D; +pub const EM_SETIMEMODEBIAS = 0x047E; +pub const MCIWNDM_GETPALETTE = 0x047E; +pub const PSM_SETHEADERTITLEW = 0x047E; +pub const EM_GETIMEMODEBIAS = 0x047F; +pub const MCIWNDM_SETPALETTE = 0x047F; +pub const PSM_SETHEADERSUBTITLEA = 0x047F; +pub const MCIWNDM_GETERRORA = 0x0480; +pub const PSM_SETHEADERSUBTITLEW = 0x0480; +pub const PSM_HWNDTOINDEX = 0x0481; +pub const PSM_INDEXTOHWND = 0x0482; +pub const MCIWNDM_SETINACTIVETIMER = 0x0483; +pub const PSM_PAGETOINDEX = 0x0483; +pub const PSM_INDEXTOPAGE = 0x0484; +pub const DL_BEGINDRAG = 0x0485; +pub const MCIWNDM_GETINACTIVETIMER = 0x0485; +pub const PSM_IDTOINDEX = 0x0485; +pub const DL_DRAGGING = 0x0486; +pub const PSM_INDEXTOID = 0x0486; +pub const DL_DROPPED = 0x0487; +pub const PSM_GETRESULT = 0x0487; +pub const DL_CANCELDRAG = 0x0488; +pub const PSM_RECALCPAGESIZES = 0x0488; +pub const MCIWNDM_GET_SOURCE = 0x048C; +pub const MCIWNDM_PUT_SOURCE = 0x048D; +pub const MCIWNDM_GET_DEST = 0x048E; +pub const MCIWNDM_PUT_DEST = 0x048F; +pub const MCIWNDM_CAN_PLAY = 0x0490; +pub const MCIWNDM_CAN_WINDOW = 0x0491; +pub const MCIWNDM_CAN_RECORD = 0x0492; +pub const MCIWNDM_CAN_SAVE = 0x0493; +pub const MCIWNDM_CAN_EJECT = 0x0494; +pub const MCIWNDM_CAN_CONFIG = 0x0495; +pub const IE_GETINK = 0x0496; +pub const MCIWNDM_PALETTEKICK = 0x0496; +pub const IE_SETINK = 0x0497; +pub const IE_GETPENTIP = 0x0498; +pub const IE_SETPENTIP = 0x0499; +pub const IE_GETERASERTIP = 0x049A; +pub const IE_SETERASERTIP = 0x049B; +pub const IE_GETBKGND = 0x049C; +pub const IE_SETBKGND = 0x049D; +pub const IE_GETGRIDORIGIN = 0x049E; +pub const IE_SETGRIDORIGIN = 0x049F; +pub const IE_GETGRIDPEN = 0x04A0; +pub const IE_SETGRIDPEN = 0x04A1; +pub const IE_GETGRIDSIZE = 0x04A2; +pub const IE_SETGRIDSIZE = 0x04A3; +pub const IE_GETMODE = 0x04A4; +pub const IE_SETMODE = 0x04A5; +pub const IE_GETINKRECT = 0x04A6; +pub const WM_CAP_SET_MCI_DEVICEW = 0x04A6; +pub const WM_CAP_GET_MCI_DEVICEW = 0x04A7; +pub const WM_CAP_PAL_OPENW = 0x04B4; +pub const WM_CAP_PAL_SAVEW = 0x04B5; +pub const IE_GETAPPDATA = 0x04B8; +pub const IE_SETAPPDATA = 0x04B9; +pub const IE_GETDRAWOPTS = 0x04BA; +pub const IE_SETDRAWOPTS = 0x04BB; +pub const IE_GETFORMAT = 0x04BC; +pub const IE_SETFORMAT = 0x04BD; +pub const IE_GETINKINPUT = 0x04BE; +pub const IE_SETINKINPUT = 0x04BF; +pub const IE_GETNOTIFY = 0x04C0; +pub const IE_SETNOTIFY = 0x04C1; +pub const IE_GETRECOG = 0x04C2; +pub const IE_SETRECOG = 0x04C3; +pub const IE_GETSECURITY = 0x04C4; +pub const IE_SETSECURITY = 0x04C5; +pub const IE_GETSEL = 0x04C6; +pub const IE_SETSEL = 0x04C7; +pub const EM_SETBIDIOPTIONS = 0x04C8; +pub const IE_DOCOMMAND = 0x04C8; +pub const MCIWNDM_NOTIFYMODE = 0x04C8; +pub const EM_GETBIDIOPTIONS = 0x04C9; +pub const IE_GETCOMMAND = 0x04C9; +pub const EM_SETTYPOGRAPHYOPTIONS = 0x04CA; +pub const IE_GETCOUNT = 0x04CA; +pub const EM_GETTYPOGRAPHYOPTIONS = 0x04CB; +pub const IE_GETGESTURE = 0x04CB; +pub const MCIWNDM_NOTIFYMEDIA = 0x04CB; +pub const EM_SETEDITSTYLE = 0x04CC; +pub const IE_GETMENU = 0x04CC; +pub const EM_GETEDITSTYLE = 0x04CD; +pub const IE_GETPAINTDC = 0x04CD; +pub const MCIWNDM_NOTIFYERROR = 0x04CD; +pub const IE_GETPDEVENT = 0x04CE; +pub const IE_GETSELCOUNT = 0x04CF; +pub const IE_GETSELITEMS = 0x04D0; +pub const IE_GETSTYLE = 0x04D1; +pub const MCIWNDM_SETTIMEFORMATW = 0x04DB; +pub const EM_OUTLINE = 0x04DC; +pub const MCIWNDM_GETTIMEFORMATW = 0x04DC; +pub const EM_GETSCROLLPOS = 0x04DD; +pub const EM_SETSCROLLPOS = 0x04DE; +pub const EM_SETFONTSIZE = 0x04DF; +pub const EM_GETZOOM = 0x04E0; +pub const MCIWNDM_GETFILENAMEW = 0x04E0; +pub const EM_SETZOOM = 0x04E1; +pub const MCIWNDM_GETDEVICEW = 0x04E1; +pub const EM_GETVIEWKIND = 0x04E2; +pub const EM_SETVIEWKIND = 0x04E3; +pub const EM_GETPAGE = 0x04E4; +pub const MCIWNDM_GETERRORW = 0x04E4; +pub const EM_SETPAGE = 0x04E5; +pub const EM_GETHYPHENATEINFO = 0x04E6; +pub const EM_SETHYPHENATEINFO = 0x04E7; +pub const EM_GETPAGEROTATE = 0x04EB; +pub const EM_SETPAGEROTATE = 0x04EC; +pub const EM_GETCTFMODEBIAS = 0x04ED; +pub const EM_SETCTFMODEBIAS = 0x04EE; +pub const EM_GETCTFOPENSTATUS = 0x04F0; +pub const EM_SETCTFOPENSTATUS = 0x04F1; +pub const EM_GETIMECOMPTEXT = 0x04F2; +pub const EM_ISIME = 0x04F3; +pub const EM_GETIMEPROPERTY = 0x04F4; +pub const EM_GETQUERYRTFOBJ = 0x050D; +pub const EM_SETQUERYRTFOBJ = 0x050E; +pub const FM_GETFOCUS = 0x0600; +pub const FM_GETDRIVEINFOA = 0x0601; +pub const FM_GETSELCOUNT = 0x0602; +pub const FM_GETSELCOUNTLFN = 0x0603; +pub const FM_GETFILESELA = 0x0604; +pub const FM_GETFILESELLFNA = 0x0605; +pub const FM_REFRESH_WINDOWS = 0x0606; +pub const FM_RELOAD_EXTENSIONS = 0x0607; +pub const FM_GETDRIVEINFOW = 0x0611; +pub const FM_GETFILESELW = 0x0614; +pub const FM_GETFILESELLFNW = 0x0615; +pub const WLX_WM_SAS = 0x0659; +pub const SM_GETSELCOUNT = 0x07E8; +pub const UM_GETSELCOUNT = 0x07E8; +pub const WM_CPL_LAUNCH = 0x07E8; +pub const SM_GETSERVERSELA = 0x07E9; +pub const UM_GETUSERSELA = 0x07E9; +pub const WM_CPL_LAUNCHED = 0x07E9; +pub const SM_GETSERVERSELW = 0x07EA; +pub const UM_GETUSERSELW = 0x07EA; +pub const SM_GETCURFOCUSA = 0x07EB; +pub const UM_GETGROUPSELA = 0x07EB; +pub const SM_GETCURFOCUSW = 0x07EC; +pub const UM_GETGROUPSELW = 0x07EC; +pub const SM_GETOPTIONS = 0x07ED; +pub const UM_GETCURFOCUSA = 0x07ED; +pub const UM_GETCURFOCUSW = 0x07EE; +pub const UM_GETOPTIONS = 0x07EF; +pub const UM_GETOPTIONS2 = 0x07F0; +pub const LVM_GETBKCOLOR = 0x1000; +pub const LVM_SETBKCOLOR = 0x1001; +pub const LVM_GETIMAGELIST = 0x1002; +pub const LVM_SETIMAGELIST = 0x1003; +pub const LVM_GETITEMCOUNT = 0x1004; +pub const LVM_GETITEMA = 0x1005; +pub const LVM_SETITEMA = 0x1006; +pub const LVM_INSERTITEMA = 0x1007; +pub const LVM_DELETEITEM = 0x1008; +pub const LVM_DELETEALLITEMS = 0x1009; +pub const LVM_GETCALLBACKMASK = 0x100A; +pub const LVM_SETCALLBACKMASK = 0x100B; +pub const LVM_GETNEXTITEM = 0x100C; +pub const LVM_FINDITEMA = 0x100D; +pub const LVM_GETITEMRECT = 0x100E; +pub const LVM_SETITEMPOSITION = 0x100F; +pub const LVM_GETITEMPOSITION = 0x1010; +pub const LVM_GETSTRINGWIDTHA = 0x1011; +pub const LVM_HITTEST = 0x1012; +pub const LVM_ENSUREVISIBLE = 0x1013; +pub const LVM_SCROLL = 0x1014; +pub const LVM_REDRAWITEMS = 0x1015; +pub const LVM_ARRANGE = 0x1016; +pub const LVM_EDITLABELA = 0x1017; +pub const LVM_GETEDITCONTROL = 0x1018; +pub const LVM_GETCOLUMNA = 0x1019; +pub const LVM_SETCOLUMNA = 0x101A; +pub const LVM_INSERTCOLUMNA = 0x101B; +pub const LVM_DELETECOLUMN = 0x101C; +pub const LVM_GETCOLUMNWIDTH = 0x101D; +pub const LVM_SETCOLUMNWIDTH = 0x101E; +pub const LVM_GETHEADER = 0x101F; +pub const LVM_CREATEDRAGIMAGE = 0x1021; +pub const LVM_GETVIEWRECT = 0x1022; +pub const LVM_GETTEXTCOLOR = 0x1023; +pub const LVM_SETTEXTCOLOR = 0x1024; +pub const LVM_GETTEXTBKCOLOR = 0x1025; +pub const LVM_SETTEXTBKCOLOR = 0x1026; +pub const LVM_GETTOPINDEX = 0x1027; +pub const LVM_GETCOUNTPERPAGE = 0x1028; +pub const LVM_GETORIGIN = 0x1029; +pub const LVM_UPDATE = 0x102A; +pub const LVM_SETITEMSTATE = 0x102B; +pub const LVM_GETITEMSTATE = 0x102C; +pub const LVM_GETITEMTEXTA = 0x102D; +pub const LVM_SETITEMTEXTA = 0x102E; +pub const LVM_SETITEMCOUNT = 0x102F; +pub const LVM_SORTITEMS = 0x1030; +pub const LVM_SETITEMPOSITION32 = 0x1031; +pub const LVM_GETSELECTEDCOUNT = 0x1032; +pub const LVM_GETITEMSPACING = 0x1033; +pub const LVM_GETISEARCHSTRINGA = 0x1034; +pub const LVM_SETICONSPACING = 0x1035; +pub const LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036; +pub const LVM_GETEXTENDEDLISTVIEWSTYLE = 0x1037; +pub const LVM_GETSUBITEMRECT = 0x1038; +pub const LVM_SUBITEMHITTEST = 0x1039; +pub const LVM_SETCOLUMNORDERARRAY = 0x103A; +pub const LVM_GETCOLUMNORDERARRAY = 0x103B; +pub const LVM_SETHOTITEM = 0x103C; +pub const LVM_GETHOTITEM = 0x103D; +pub const LVM_SETHOTCURSOR = 0x103E; +pub const LVM_GETHOTCURSOR = 0x103F; +pub const LVM_APPROXIMATEVIEWRECT = 0x1040; +pub const LVM_SETWORKAREAS = 0x1041; +pub const LVM_GETSELECTIONMARK = 0x1042; +pub const LVM_SETSELECTIONMARK = 0x1043; +pub const LVM_SETBKIMAGEA = 0x1044; +pub const LVM_GETBKIMAGEA = 0x1045; +pub const LVM_GETWORKAREAS = 0x1046; +pub const LVM_SETHOVERTIME = 0x1047; +pub const LVM_GETHOVERTIME = 0x1048; +pub const LVM_GETNUMBEROFWORKAREAS = 0x1049; +pub const LVM_SETTOOLTIPS = 0x104A; +pub const LVM_GETITEMW = 0x104B; +pub const LVM_SETITEMW = 0x104C; +pub const LVM_INSERTITEMW = 0x104D; +pub const LVM_GETTOOLTIPS = 0x104E; +pub const LVM_FINDITEMW = 0x1053; +pub const LVM_GETSTRINGWIDTHW = 0x1057; +pub const LVM_GETCOLUMNW = 0x105F; +pub const LVM_SETCOLUMNW = 0x1060; +pub const LVM_INSERTCOLUMNW = 0x1061; +pub const LVM_GETITEMTEXTW = 0x1073; +pub const LVM_SETITEMTEXTW = 0x1074; +pub const LVM_GETISEARCHSTRINGW = 0x1075; +pub const LVM_EDITLABELW = 0x1076; +pub const LVM_GETBKIMAGEW = 0x108B; +pub const LVM_SETSELECTEDCOLUMN = 0x108C; +pub const LVM_SETTILEWIDTH = 0x108D; +pub const LVM_SETVIEW = 0x108E; +pub const LVM_GETVIEW = 0x108F; +pub const LVM_INSERTGROUP = 0x1091; +pub const LVM_SETGROUPINFO = 0x1093; +pub const LVM_GETGROUPINFO = 0x1095; +pub const LVM_REMOVEGROUP = 0x1096; +pub const LVM_MOVEGROUP = 0x1097; +pub const LVM_MOVEITEMTOGROUP = 0x109A; +pub const LVM_SETGROUPMETRICS = 0x109B; +pub const LVM_GETGROUPMETRICS = 0x109C; +pub const LVM_ENABLEGROUPVIEW = 0x109D; +pub const LVM_SORTGROUPS = 0x109E; +pub const LVM_INSERTGROUPSORTED = 0x109F; +pub const LVM_REMOVEALLGROUPS = 0x10A0; +pub const LVM_HASGROUP = 0x10A1; +pub const LVM_SETTILEVIEWINFO = 0x10A2; +pub const LVM_GETTILEVIEWINFO = 0x10A3; +pub const LVM_SETTILEINFO = 0x10A4; +pub const LVM_GETTILEINFO = 0x10A5; +pub const LVM_SETINSERTMARK = 0x10A6; +pub const LVM_GETINSERTMARK = 0x10A7; +pub const LVM_INSERTMARKHITTEST = 0x10A8; +pub const LVM_GETINSERTMARKRECT = 0x10A9; +pub const LVM_SETINSERTMARKCOLOR = 0x10AA; +pub const LVM_GETINSERTMARKCOLOR = 0x10AB; +pub const LVM_SETINFOTIP = 0x10AD; +pub const LVM_GETSELECTEDCOLUMN = 0x10AE; +pub const LVM_ISGROUPVIEWENABLED = 0x10AF; +pub const LVM_GETOUTLINECOLOR = 0x10B0; +pub const LVM_SETOUTLINECOLOR = 0x10B1; +pub const LVM_CANCELEDITLABEL = 0x10B3; +pub const LVM_MAPINDEXTOID = 0x10B4; +pub const LVM_MAPIDTOINDEX = 0x10B5; +pub const LVM_ISITEMVISIBLE = 0x10B6; +pub const OCM__BASE = 0x2000; +pub const LVM_SETUNICODEFORMAT = 0x2005; +pub const LVM_GETUNICODEFORMAT = 0x2006; +pub const OCM_CTLCOLOR = 0x2019; +pub const OCM_DRAWITEM = 0x202B; +pub const OCM_MEASUREITEM = 0x202C; +pub const OCM_DELETEITEM = 0x202D; +pub const OCM_VKEYTOITEM = 0x202E; +pub const OCM_CHARTOITEM = 0x202F; +pub const OCM_COMPAREITEM = 0x2039; +pub const OCM_NOTIFY = 0x204E; +pub const OCM_COMMAND = 0x2111; +pub const OCM_HSCROLL = 0x2114; +pub const OCM_VSCROLL = 0x2115; +pub const OCM_CTLCOLORMSGBOX = 0x2132; +pub const OCM_CTLCOLOREDIT = 0x2133; +pub const OCM_CTLCOLORLISTBOX = 0x2134; +pub const OCM_CTLCOLORBTN = 0x2135; +pub const OCM_CTLCOLORDLG = 0x2136; +pub const OCM_CTLCOLORSCROLLBAR = 0x2137; +pub const OCM_CTLCOLORSTATIC = 0x2138; +pub const OCM_PARENTNOTIFY = 0x2210; +pub const WM_APP = 0x8000; +pub const WM_RASDIALEVENT = 0xCCCD; pub extern "user32" fn GetMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL; pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void { diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig index 8c1adbb01c..e1c22e2860 100644 --- a/lib/std/packed_int_array.zig +++ b/lib/std/packed_int_array.zig @@ -30,13 +30,13 @@ pub fn PackedIntIo(comptime Int: type, comptime endian: Endian) type { const min_io_bits = ((int_bits + 7) / 8) * 8; //in the worst case, this is the number of bytes we need to touch - // to read or write a value, as bits + // to read or write a value, as bits. To calculate for int_bits > 1, + // set aside 2 bits to touch the first and last bytes, then divide + // by 8 to see how many bytes can be filled up inbetween. const max_io_bits = switch (int_bits) { 0 => 0, 1 => 8, - 2...9 => 16, - 10...65535 => ((int_bits / 8) + 2) * 8, - else => unreachable, + else => ((int_bits - 2) / 8 + 2) * 8, }; //we bitcast the desired Int type to an unsigned version of itself @@ -378,12 +378,20 @@ test "PackedIntArray" { } } +test "PackedIntIo" { + const bytes = [_]u8 { 0b01101_000, 0b01011_110, 0b00011_101 }; + try testing.expectEqual(@as(u15, 0x2bcd), PackedIntIo(u15, .Little).get(&bytes, 0, 3)); + try testing.expectEqual(@as(u16, 0xabcd), PackedIntIo(u16, .Little).get(&bytes, 0, 3)); + try testing.expectEqual(@as(u17, 0x1abcd), PackedIntIo(u17, .Little).get(&bytes, 0, 3)); + try testing.expectEqual(@as(u18, 0x3abcd), PackedIntIo(u18, .Little).get(&bytes, 0, 3)); +} + test "PackedIntArray init" { if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; const PackedArray = PackedIntArray(u3, 8); var packed_array = PackedArray.init([_]u3{ 0, 1, 2, 3, 4, 5, 6, 7 }); var i = @as(usize, 0); - while (i < packed_array.len()) : (i += 1) testing.expectEqual(@intCast(u3, i), packed_array.get(i)); + while (i < packed_array.len()) : (i += 1) try testing.expectEqual(@intCast(u3, i), packed_array.get(i)); } test "PackedIntArray initAllTo" { @@ -391,7 +399,7 @@ test "PackedIntArray initAllTo" { const PackedArray = PackedIntArray(u3, 8); var packed_array = PackedArray.initAllTo(5); var i = @as(usize, 0); - while (i < packed_array.len()) : (i += 1) testing.expectEqual(@as(u3, 5), packed_array.get(i)); + while (i < packed_array.len()) : (i += 1) try testing.expectEqual(@as(u3, 5), packed_array.get(i)); } test "PackedIntSlice" { |
